How do I replace #VALUE! error for blank cells with blank cell

coast331

Board Regular
Joined
Nov 2, 2008
Messages
85
The formula below calculates appropriately, however, if any of the cells (E12,E14, E21, E22, E28, E29) are blank, it returns a #VALUE! error. I would like the cell to remain blank. How can I do this? The formula is listed below.

=(SUM(E34-E6)-(SUM((E12)+E14)-(SUM((E21)+E22)-(SUM(E28)+E29))))

Thanks so much.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You might check to see if any of your cell references have a space in them instead of just being blank That would cause this error.

Using your exact formula, you can add an if statement combined with ISERR so that in the event your formula gives an error message, a 0 will populate the cell.

=IF(ISERR((SUM(E34-E6)-(SUM((E12)+E14)-(SUM((E21)+E22)-(SUM(E28)+E29))))),0,(SUM(E34-E6)-(SUM((E12)+E14)-(SUM((E21)+E22)-(SUM(E28)+E29)))))

Are you sure you need all of those parentheses?
 
Upvote 0
Your formula is the equivalent of

=SUM(E21:E22,E34)-SUM(E6,E12,E14,E28:E29)

If you write it like that you shouldn't get an error because of any blanks

If you only want to show a result when all of those cells contain numbers then you could amend to

=IF(COUNT(E6,E12,E14,E21,E22,E28,E29,E34)=8,SUM(E21:E22,E34)-SUM(E6,E12,E14,E28:E29),"")
 
Upvote 0
When I plug in each of the responses that have been offered, it returns -35 when the answer with my original formula is 5.

Is this some sort of an error message as well?
 
Upvote 0
Try this

=IF(ISERROR((SUM(E34-E6)-(SUM((E12)+E14)-(SUM((E21)+E22)-(SUM(E28)+E29))))),"",(SUM(E34-E6)-(SUM((E12)+E14)-(SUM((E21)+E22)-(SUM(E28)+E29)))))
 
Upvote 0
Thank you but when I plug this latest change in, it returns 8 when all the cells are blank. I have been looking at the suggestions very closely and still can't figure out the remaining issue.

Thanks for your help.
 
Upvote 0
Hi coast331,

Could you place a copy of your worksheet so we may look at the workings as the formula I placed should return exactly the same result but only will return blank if it returns an error...

Thanks
 
Upvote 0
Do the cells in question house formulas?

Do you want a blank result when any one cell is blank or when all the cells are blank?
 
Upvote 0
Yes, the identified cells do house formulas. I need a blank result when all the identified cells are blank. As long as D34 and D6 have data, the formula also should still work - D12, D14, D21, D22, D28 and D29 should =0 if blank.

I hope this helps to clarify my issue.

Thank You.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,246
Members
449,075
Latest member
staticfluids

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