IF Statements

docjackson33

New Member
Joined
Feb 7, 2010
Messages
18
How do you use the "if multiple cells are blank, then leave blank, if true sum those cells?

Example: =IF(A1="","",IF(A2="","",IF(A3="","",SUM(A1:A3))))

This is what I tried, but it still placed 0's in the cell. I tried putting a space between the (" ") and it didn't calculate at all.

Thanks in Advance.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
If I understand your question correctly, your formula...
=IF(A1="","",IF(A2="","",IF(A3="","",SUM(A1:A3))))
...should work if A1, A2, or A3 is blank (no spaces), then it should return nothing (not zero). I tested it and it seemed to work for me.

Here's another way it could be done.
=IF(COUNTIF(A1:A3,"")=0,SUM(A1:A3),"")

Or this...
=IF(COUNTBLANK(A1:A3),"",SUM(A1:A3))
 
Last edited:
Upvote 0
I made a small table...A1:A8 was filled w/ random number, B1:B8 had a few blank cells, and C1:C8 was all blank. Then I tried all three formulas, and I got blanks for columns B/C. And I'm not sure why because 'B' had values in it.

Side note: I'm just barely grasping the concept of utilizing formulas, and I just couldn't talk out the logic in the two that you sent to me. Could you explain those to me?

Thanks.
 
Upvote 0
The two formulas I gave you will only sum the cells if ALL the cells have a value. If any cell is empty, then no sum.

=IF(COUNTBLANK(A1:A3),"",SUM(A1:A3))

If any cell in A1 to A3 is empty, then the formula returns a Blank. If ALL three cells in A1 to A3 have values, then the formula returns the sum of those three values.

I thought that's what you wanted based on your original question. If I've missed it, then please explain better what you want to do.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top