Sumproduct formula is double counting a range

rrmando18

New Member
Joined
Sep 13, 2022
Messages
8
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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
Hello. The name of the sheet the formula is in is Journal. Thanks!
 
Upvote 0
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,215,514
Messages
6,125,273
Members
449,219
Latest member
daynle

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