SUMPRODUCT - ignoring blanks in the table

Ronnie12345

New Member
Joined
Mar 24, 2017
Messages
18
Hi Mr Excel,

I like using SUMPRODUCT but SUMPRODUCT doesn't like blanks in my tables. It returns #VALUE ! when there's a blank.
Is there a quick and easy way get around this, for example using the example below. Apologies for the cumbersome table posting... but cell D6 has a blank which causes the formula to return the VALUE error. Can this blank be ignored?

a b c d e f g h i


SmithJonesSmithJonesSmithJonesSmith
Apples12481632Apples
Pears248163264#VALUE !
Bananas3612244896
Oranges48163264128SUMPRODUCT((B1:G1=I1)*(A2:A17=I2)*(B2:G17))
Apples510 4080160
Pears612244896192
Bananas7142856112224
Oranges8163264128256
Apples9183672144288
Pears10204080160320
Bananas11224488176352
Oranges12244896192384
Apples132652104208416
Pears142856112224448
Bananas153060120240480
Oranges163264128256512

<colgroup><col width="64" span="13" style="width:48pt"> </colgroup><tbody>
</tbody>



















<tbody>
</tbody>
 
Thank you so much, that works perfectly.
You're welcome.


How does it work? What does 0& actually do?
0& puts a 0 in front of the "" making it "0". When the multiplication of that final term in the formula takes place, Excel knows to interpret that as a zero, which is what we want.
The 0& also puts a zero in front of all the other numbers too but, for example, "028" still gets interpreted as 28 so no problems there.
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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