View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Multiplying Empty Cells

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Workbook" wrote in message
...
Wow! Once again, thank you for your help. Both options are great.

"T. Valko" wrote:

=IF(COUNT(M4)<2,"",(M4*24)-1)


Since you're testing a single cell try it like this:

=IF(COUNT(M4),(M4*24)-1,"")

COUNT returns the count of numbers referenced in its arguments. If you're
testing a single cell the result of COUNT can only be 1 or 0. Excel
evaluates *any* number other than 0 as being TRUE. So, if COUNT =1
VLOOKUP
returns the value_if_true argument which is M4*24)-1. If COUNT =0
VLOOKUP
returns the value_if_false argument which is "", an empty TEXT string
that
makes the cell appear blank.

You could also use something like this:

=IF(M4<"",(M4*24)-1,"")

Which means: if M4 is not equal to blank

However, if M4 contained a TEXT entry (either by mistake or
intentionally)
then you'll get a #VALUE! error as the formula result. So, using the
=IF(COUNT(M4)... version is more robust.

--
Biff
Microsoft Excel MVP


"Workbook" wrote in message
...
In cell N15, I am using this formula M15*24. However sometimes M15 is
blank
and when it is I get a message in cell N15 that says #VALUE!. Which
throws
off other formulas.

I need help adding an IF statement to this formula M15*24 so that cell
N15
in which the formula is located will become blank or "0" when M15 does
not
have a value/is blank. Biff and JE McGimpsey recommended I use
=IF(COUNT(K15:L15)<2,"" for a similar problem I had while subtracting
dates
and it has worked awesome. I tried adding it to the current formula
and I
came up with =IF(COUNT(M4)<2,"",(M4*24)-1) but I didn't get the same
result
which is the blank cell I was looking for. Any thoughts?