ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum if not blank (https://www.excelbanter.com/excel-worksheet-functions/246627-sum-if-not-blank.html)

SKSmith

Sum if not blank
 
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.

Luke M

Sum if not blank
 
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)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SKSmith" wrote:

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.


Glenn

Sum if not blank
 
SKSmith wrote:
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.


All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com