Sumproduct formula is double counting a range

rrmando18

New Member
Joined
Sep 13, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hello party people. I don't have much experience with the SUMPRODUCT function and it's kicking my butt. I have to criteria in the formula below and the result is double counting the (Paychex!$AA$5:$AA$100) range. Why is that? If my range is two columns there's no problem but when I use only one column in the range it double counts. How do I fix it or is there a more efficient formula I can use? Thanks.


I want to add the values in ((Paychex!$W$5:$X$100)+(Paychex!$AA$5:$AA$100)+(Paychex!$AB$5:$AC$100)+(Paychex!$AF$5:$AG$100) based on the two criteria (Paychex!$A$5:$A$100=Journal!$B$3)*(Paychex!$J$5:$J$100=Journal!$E$1)


=SUMPRODUCT((Paychex!$A$5:$A$100=Journal!$B$3)*(Paychex!$J$5:$J$100=Journal!$E$1)*((Paychex!$W$5:$X$100)+(Paychex!$AA$5:$AA$100)+(Paychex!$AB$5:$AC$100)+(Paychex!$AF$5:$AG$100)))
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Welcome to posting on the MrExcel board!

is there a more efficient formula I can use?
Try this
Excel Formula:
=SUM(FILTER(CHOOSECOLS(Paychex!$W$5:$AG$100,1,2,5,6,7,10,11),(Paychex!$A$5:$A$100=Journal!$B$3)*(Paychex!$J$5:$J$100=Journal!$E$1),0))

BTW, what is the name of the sheet that this formula is on?
 
Upvote 0
Solution
Welcome to posting on the MrExcel board!


Try this
Excel Formula:
=SUM(FILTER(CHOOSECOLS(Paychex!$W$5:$AG$100,1,2,5,6,7,10,11),(Paychex!$A$5:$A$100=Journal!$B$3)*(Paychex!$J$5:$J$100=Journal!$E$1),0))

BTW, what is the name of the sheet that this formula is on?
Thank you so much Peter....that formula worked like a charm!
 
Upvote 0
Thank you so much Peter....that formula worked like a charm!
You're welcome. Thanks for the confirmation. :)

The name of the sheet the formula is in is Journal.
In that case I would suggest changing the formula as it is a bad idea to use the sheet name that the formula is on when referencing cells/ranges on that sheet. It can lead to incorrect results in some circumstances.
Use this instead
Excel Formula:
=SUM(FILTER(CHOOSECOLS(Paychex!$W$5:$AG$100,1,2,5,6,7,10,11),(Paychex!$A$5:$A$100=$B$3)*(Paychex!$J$5:$J$100=$E$1),0))
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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