Sum if not blank

S

SKSmith

I have a column for a simple running balance. I have used the formula that
sez if >0... so that if nothing is in the cell, then the running balance will
be blank; I don't want zeros,or the last accurate balance to be populated
down the column. So here's the formula I've been using:
=IF(H3> 0,SUM(I2+H3)," ")
But What I really want is if it is blank. Because now I'd like to add
negative numbers in Column I; but then the formula above won't work. I've
tried if H3>" ", but that returns an error. So, my question is - how do you
write a clean formula to sum only if Column I contains a value? Thanks for
any help.
 
L

Luke M

I'm confused. Your formula mentions H, but your sentence mentions I. Which
column are you checking? Either way, you can use either ISNUMBER or COUNT()=1
like this:

=IF(ISNUMBER(H3),I2+H3,"")
or
=IF(COUNT(H3)=1,I2+H3,"")

Technically, the first function is faster (by a few microseconds)
 
G

Glenn

SKSmith said:
I have a column for a simple running balance. I have used the formula that
sez if >0... so that if nothing is in the cell, then the running balance will
be blank; I don't want zeros,or the last accurate balance to be populated
down the column. So here's the formula I've been using:
=IF(H3> 0,SUM(I2+H3)," ")
But What I really want is if it is blank. Because now I'd like to add
negative numbers in Column I; but then the formula above won't work. I've
tried if H3>" ", but that returns an error. So, my question is - how do you
write a clean formula to sum only if Column I contains a value? Thanks for
any help.


Just keep in mind that " " is not blank, that is a space. "" is blank. Drop
the "SUM", which is not needed, and you get something like this:

=IF(H3="","",I2+H3)

Or, go with what Luke suggested.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top