SUMPRODUCT with FILTER Criteria

brncao

Board Regular
Joined
Apr 28, 2015
Messages
149
Hello,

I am trying to figure out a solution to this problem. In most of the online guides I've read regarding SUMPRODUCT with conditions, it assumes you know what criteria you'll provide. The problem is I don't. Rather than having "array = criteria1," it should be something like "array = {criteria1,criteria2, criteria_n}." The number of criteria inside {} is determined by a FILTER function. However, it will throw a #N/A error. Does anyone know the solution to this problem?

In the example below, different regions will use synonymous words. I'll need to map them to a single common word in order for me to analyze the data. The SUMPRODUCT table is what needs to be solved. It should match the Result table.
Book2.xlsx
ABCDEFGHIJKLM
1MappingTableSheet2/Region1AmountSheet3/Region2AmountSheet 4/Region3Amount
2MappingRegion1Region2Region3Auto1Automobile2Vehicle5
3AutomobileAutoVehicleCar4Pop4Coke5
4AutomobileCarAutomobileSoda7Biscuits7Cookies4
5SodaSodaPopCokePop4Jet9Turboprop3
6SodaPopCookies8Airplane10
7CookiesBiscuitsCookiesPlane2Plane1
8AirplanePlaneJetTurbopropAirplane5
9AirplaneAirplane
10AirplanePlane
11
12
13
14
15
16SUMPRODUCTRegion1 AmountRegion2 AmountRegion3 Amount
17Automobile#N/A#N/A#N/A
18Soda#N/A#N/A#N/A
19Cookies074
20Airplane#N/A#N/A#N/A
21
22
23ResultRegion1 AmountRegion2 AmountRegion3 Amount
24Automobile525
25Soda1145
26Cookies074
27Airplane7203
Sheet1
Cell Formulas
RangeFormula
B17:B20B17=SUMPRODUCT($G$2:$G$14,--($F$2:$F$14=FILTER(B$3:B$10,$A$3:$A$10=$A17)))
C17:C20C17=SUMPRODUCT($J$2:$J$14,--($I$2:$I$14=FILTER(C$3:C$10,$A$3:$A$10=$A17)))
D17:D20D17=SUMPRODUCT($M$2:$M$14,--($L$2:$L$14=FILTER(D$3:D$10,$A$3:$A$10=$A17)))
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
How about
Excel Formula:
=SUMPRODUCT($G$2:$G$14,--(ISNUMBER(XMATCH($F$2:$F$14,FILTER(B$3:B$10,$A$3:$A$10=$A17)))))
 
Upvote 0
Solution
How about
Excel Formula:
=SUMPRODUCT($G$2:$G$14,--(ISNUMBER(XMATCH($F$2:$F$14,FILTER(B$3:B$10,$A$3:$A$10=$A17)))))
Thank you! It worked!

SUMPRODUCT Problem.xlsx
ABCDEFGHIJKLM
1MappingTableSheet2/Region1AmountSheet3/Region2AmountSheet 4/Region3Amount
2MappingRegion1Region2Region3Auto1Automobile2Vehicle5
3AutomobileAutoVehicleCar4Pop4Coke5
4AutomobileCarAutomobileSoda7Biscuits7Cookies4
5SodaSodaPopCokePop4Jet9Turboprop3
6SodaPopCookies8Airplane10
7CookiesBiscuitsCookiesPlane2Plane1
8AirplanePlaneJetTurboprop
9AirplaneAirplane
10AirplanePlane
11
12
13
14
15
16SUMPRODUCTRegion1 AmountRegion2 AmountRegion3 Amount
17Automobile525
18Soda1145
19Cookies074
20Airplane2203
21
22
23ResultRegion1 AmountRegion2 AmountRegion3 Amount
24Automobile525
25Soda1145
26Cookies074
27Airplane2203
Sheet1
Cell Formulas
RangeFormula
B17:B20B17=SUMPRODUCT($G$2:$G$14,--(ISNUMBER(XMATCH($F$2:$F$14,FILTER(B$3:B$10,$A$3:$A$10=$A17)))))
C17:C20C17=SUMPRODUCT($J$2:$J$14,--(ISNUMBER(XMATCH($I$2:$I$14,FILTER(C$3:C$10,$A$3:$A$10=$A17)))))
D17:D20D17=SUMPRODUCT($M$2:$M$14,--(ISNUMBER(XMATCH($L$2:$L$14,FILTER(D$3:D$10,$A$3:$A$10=$A17)))))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,171
Members
452,615
Latest member
bogeys2birdies

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