Simplify Sumproduct formula

dlmoore99

Board Regular
Joined
May 20, 2011
Messages
88
Office Version
  1. 2019
Platform
  1. MacOS
I'm trying to simplify a Sumproduct formula but can't figure out how to do so. current formula is:

=SUMPRODUCT((H3:H100=$K$3)*(E3:E100="Dunkin")+(H3:H100=$K$3)*(E3:E100="t-bones")+(H3:H100=$K$3)*(E3:E100="hannafords")+(H3:H100=$K$3)*(E3:E100="starbucks")+(H3:H100=$K$3)*(E3:E100="lowes")+(H3:H100=$K$3)*(E3:E100="subway"),C3:C100),

have tried following , but with #VALUE error:

=SUMPRODUCT((H3:H100=$K$3)*(E3:E100={"Dunkin","t-bones","hannafords","starbucks","lowes","subway"}),C3:C100)

thank you for any help in the matter
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try using:

Excel Formula:
=SUMPRODUCT((H3:H100=$K$3)*(E3:E100={"Dunkin","t-bones","hannafords","starbucks","lowes","subway"})*C3:C100)
 
Upvote 0
Solution
Thank you so much, but why does the ),C3:C100) at the end of another formula work: =SUMPRODUCT((H3:H100=$K$3)*(D3:D100="Yes"),C3:C100) and not in this case
 
Upvote 0
Because of the criteria array.
 
Upvote 0
so if it is just one criteria the , should work and need * with multiple criteria, or just use * no matter the criteria
 
Upvote 0
If you use commas, all the arrays must have the same dimensions. When you use a criteria array like that you end with an array with multiple rows and columns, but your data array is just one column, so you get an error. By multiplying, SUMPRODUCT actually only has one array passed to it, and simply totals it.
 
Upvote 0
ok, thanks for the explanation, helps to wrap it around the wee lil brain still learning all the nuances of excel
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,568
Members
448,972
Latest member
Shantanu2024

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