SumIf formula with multiple criteria from different tab

usnapoleon

Board Regular
Joined
May 22, 2014
Messages
80
Office Version
  1. 365
Platform
  1. Windows
I'm beating my head on this one, everything looks right to me so I could use another eye to see what I'm missing.

Here is raw data tab:

WRSD CC Reconciliation Template.xlsx
ABCDEFGHIJKLMNO
47
48AmexDiscoverMC/V
49Canyon GrilleMarket PlacePizza HutThe ShopCanyon GrilleMarket PlacePizza HutThe ShopCanyon GrilleMarket PlacePizza HutThe Shop
501-Mar5.00-----------
512-Mar------------
523-Mar------------
534-Mar------------
Test
Cell Formulas
RangeFormula
A50:A53,C50:D53A50=A9
B50:B53B50=B9+E9+F9+H9
E50:E53E50=G9
G50:G53G50=J9+M9+N9+P9
H50:I53H50=K9
J50:J53J50=O9
L50:L53L50=R9+U9+V9+X9+Z9+AC9+AD9+AF9
M50:N53M50=S9+AA9
O50:O53O50=X9+AF9


it actually goes down for 31 days, which is row 80, I only did the first few days to give you the general idea. The CC Names (Amex, Discover, MC/V) are in merged cells, I dont know if it matters. I tried unmerging and it didnt affect things.

Here is where I want the data to go. This is my AMEX tab, I have another tab for Discover and another for Visa/MC. So whatever we can accomplish here, will help me on the others.

WRSD CC Reconciliation Template.xlsx
ABCDEF
6Raw Data Code:
7Amex
8Date PostedCanyon GrilleMarket PlacePizza HutThe Shop
91-Mar0.00
10
11
12
13
AMX
Cell Formulas
RangeFormula
B9B9=IFERROR(SUMIFS(Test!B50:O80,Test!A50:A80,$A$9,Test!48:48,$A7,Test!$49:$49,B$8),0)


It's meant to identify certain criteria before delivering the result:
  1. The Raw Data Code on the amex tab's A7 to the code in row 48 of the Test tab
  2. The outlet name on the amex tab's row 8 to the name in row 49 of the Test tab
  3. The date on the amex tab's column A to the date in column A of the Test tab

=IFERROR(SUMIFS(Test!B50:O80,Test!A50:A80,$A$9,Test!48:48,$A7,Test!$49:$49,B$8),0)


Not sure where to fix.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Your SUMIFS is not working because the range arguments have different numbers of rows and columns. Per the Microsoft documentation:

Use the same number of rows and columns for range arguments.The Criteria_range argument must contain the same number of rows and columns as the Sum_range argument.

One alternative is using SUMPRODUCT instead:
In B9: =SUMPRODUCT(($A$7=Test!$B$48)*($A9=Test!$A50:$A80)*(B$8=Test!B$49:E$49)*Test!$B$50:$E$80)

Regards

Murray
 
Upvote 0
Solution
Your SUMIFS is not working because the range arguments have different numbers of rows and columns. Per the Microsoft documentation:

Use the same number of rows and columns for range arguments.The Criteria_range argument must contain the same number of rows and columns as the Sum_range argument.

One alternative is using SUMPRODUCT instead:
In B9: =SUMPRODUCT(($A$7=Test!$B$48)*($A9=Test!$A50:$A80)*(B$8=Test!B$49:E$49)*Test!$B$50:$E$80)

Regards

Murray
I didnt know that, thank you! I tried your code and it worked perfectly. Thank you for that. I've not used sumproduct much. I was using Index originally, then I was turned onto SumIf, and now I see this. Cool stuff, thank you :)
 
Upvote 0
if you are happy to rely on the order of Canyon Grill, Market Place, Pizz Hut, The Shop being consistent across all sections then the formula below should work across all columns.

20240403 SumIfs multiple dimensions usnapoleon.xlsx
ABCDE
1
2
3
4
5
6Raw Data Code:
7Discover
8Date PostedCanyon GrilleMarket PlacePizza HutThe Shop
91/03/20245101520
102/03/20245106510751085109
113/03/20245206520752085209
124/03/20245306530753085309
135/03/20240000
Discover
Cell Formulas
RangeFormula
B9:E13B9=SUMIFS(INDEX(Test!$A$50:$O$80,0,MATCH($A$7,Test!$48:$48,0)+MATCH(B$8,Test!$49:$49,0)-2),Test!$A$50:$A$80,$A9)


Test Data:

20240403 SumIfs multiple dimensions usnapoleon.xlsx
ABCDEFGHIJKLMNO
48AmexDiscoverMC/V
49DateCanyon GrilleMarket PlacePizza HutThe ShopCanyon GrilleMarket PlacePizza HutThe ShopCanyon GrilleMarket PlacePizza HutThe Shop
501-Mar51020051015200000
512-Mar510151025103510451065107510851095111511251135114
523-Mar520152025203520452065207520852095211521252135214
534-Mar530153025303530453065307530853095311531253135314
Test
Cell Formulas
RangeFormula
B52:E53,L52:O53,G52:J53B52=B51+100
 
Upvote 0

Forum statistics

Threads
1,215,203
Messages
6,123,627
Members
449,109
Latest member
Sebas8956

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