Basic SUMPRODUCT not working

Folander

New Member
Joined
Feb 16, 2016
Messages
18
Hi all,

I am having trouble with a basic sumproduct formula, it's a two criteria sumif, but I need it to be a sumproduct so it can work in a closed workbook. Can someone help work out why it won't work please? The formula does work when I remove either of the criteria but doesn't work with both.

=SUMPRODUCT((C4:C9=C4)*(C4:C9=C9),F4:F9)

1664442411224.png


Any help would be much appreciated.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Looks like one of the ranges might be wrong, what exactly are you expecting the formula to look at?
 
Upvote 0
Looks like one of the ranges might be wrong, what exactly are you expecting the formula to look at?
I just want to add up salaries and bonus. Once I get it working I will add more criteria but I'm stumped why it won't work.
 
Upvote 0
Your current version requires each row in column C to match both C4 and C9 at the same time, which can't work unless C4 and C9 contain the same value (in which case the double test is pointless anyway). You probably need to add not multiply your criteria to get an OR:

Excel Formula:
=SUMPRODUCT((C4:C9=C4)+(C4:C9=C9),F4:F9)

Though based on your picture you probably should be using column D not C.
 
Upvote 0
If you want to add together 2 different criteria in the same column then you need to use an OR syntax, not an AND syntax which you are trying to use. That method is matching criteria in the same row but different columns.
Excel Formula:
=SUMPRODUCT(((C4:C9=C4)+(C4:C9=C9)),F4:F9)
 
Upvote 0
Solution
Which column is C and which is F?
Assume "C" is code (E2000,...), F is value

Your formula is using *, means "both" not "either". Should be "+"
=SUMPRODUCT((C4:C9=C4)*(C4:C9=C9),F4:F9)

Also you may need NOT to use relative address

Try:

Code:
=SUMPRODUCT((($C$4:$C$9=$C$4)+($C$4:$C$9=$C$9))*$F$4:$F$9)
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

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