Ignoring Blank cells in a formula to avoid #value! error

whitby01

New Member
Joined
May 3, 2003
Messages
2
I have a formula to add several cells then multiply by another cell. However, any of the cells may be blank and I don't want to fill with 0.


=(D26+E26+F26+G26+H26) * I26

Whenever D26 to H26 has a blank I get the #value! error.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
whitby01 said:
I have a formula to add several cells then multiply by another cell. However, any of the cells may be blank and I don't want to fill with 0.


=(D26+E26+F26+G26+H26) * I26

Whenever D26 to H26 has a blank I get the #value! error.

There are a few ways.

One is to go to Tools/Options/View, uncheck zero values

another way would be to use an IF formula
 
Upvote 0
Avoiding the error

Two other thoughts: you seem to be adding together data in a row. If you use the sum() function, you will get no error. Because you will get an error if you changed the multiply to a divide and all the values are blank, I'd recommend this general purpose solution:
=if(sum(d26:h26)=0,"",sum(d26:h26)*i26)
This says: if the sum of all the fields is 0 (they are all blank or zero), leave the cell blank, otherwise, multiply the sum of the cells by i26. To consider: if zero is a valid response different from blank, this needs to be done differently (this is the case for some statistical functions).
 
Upvote 0
Not sure, but I think the SUM function ignores blanks, so --

=SUM(D26:H26) * I26

should fix the problem.
 
Upvote 0
Hi, whitby. Welcome to the Bored.

First of all, using your formula, if you had true blank cells anywhere in the range, it would not return a #VALUE error. If you have what looks like blank cells, they must have had a space or two entered to them. Look at one of them in your formula bar and see if there is an apostrophe showing. A space is considered text and will return an error with your formula. To avoid that, either:

1. Use jon's suggestion of a =SUM() formula, or

2. Get rid of the "blank" space cells and validate your range to just accept numbers.
 
Upvote 0

Forum statistics

Threads
1,222,229
Messages
6,164,738
Members
451,911
Latest member
HMF009

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