# Multiplying Empty Cells

W

#### Workbook

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?

W

T

#### T. Valko

=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.

J

#### JE McGimpsey

COUNT(M4) can only be 1 (if it contains a numeric value) or 0 (if it
doesn't) so IF(COUNT(M4)=2, will always execute the FALSE branch.

the problem is that your "blank" cell isn't blank - you (or someone)
probably "cleared" it using the space bar, which inserts a space
character (i.e., a text string). That's what's choking your formula.

You could use

=IF(COUNT(M25),M15*24,0)

W

#### Workbook

Wow! Once again, thank you for your help. Both options are great.

W

#### Workbook

I see you're point. Thank you for taking the time to explain that to me. I
have also appreciated your ongoing help. Thank you!

T

#### T. Valko

You're welcome. Thanks for the feedback!