Sumifs Array help

lost_in_the_sauce

Board Regular
Joined
Jan 18, 2021
Messages
128
Office Version
  1. 365
Platform
  1. Windows
I am trying to reference an array where I need to return a value in a cell if it matches 2 conditions in columns (A and B) and also a condition in the header row (row 2). I know SUMIFS cannot do this and it might be an issue for SUMPRODUCT or nested SUMS, but I have been unable to make it work. In the example below, for the second table, I want to pull values from the first table that match company (cell A1), category (Column A) and date (Row 2).


Book1
ABCDEFGHIJKLMN
1JanFebMarAprMayJunJulAugSepOctNovDec
2CompanyCategory355624604292558
3AmazeAdvertising309224728491173
4BeyondBonus3745635458412814
5CoolAdvertising46078221176170
6BeyondLegal291165591191730
7AmazeBonus42010175158456
8AmazeConsulting253813537623840
9AmazeRebates1049264665222756
10CoolBonus781304510484047
11CoolMerchandise63476255752552
12BeyondAdvertising7325571671234829
13AmazeFees20540341830042
14AmazeMembership1469335533413774
15CoolConsulting222564216204324
16BeyondFees57283786837210
17AmazeMerchandise2474137871753256
18CoolLegal627771652793444
19BeyondRebates1317206617105446
Sheet1




Book1
ABCDEFGHIJKLMN
1Amaze
2Jan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Oct-23Nov-23Dec-23
3
4Advertising
5Bonus
6Legal
7Consulting
8Rebates
9Merchandise
10Fees
11Membership
Sheet2
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
How about
Fluff.xlsm
ABCDEFGHIJKLMN
1Amaze
231/01/202328/02/202331/03/202330/04/202331/05/202330/06/202331/07/202331/08/202330/09/202331/10/202330/11/202331/12/2023
3
4Advertising3092247284911730000
5Bonus420101751584560000
6Legal000000000000
7Consulting2538135376238400000
8Rebates10492646652227560000
9Merchandise24741378717532560000
10Fees205403418300420000
11Membership14693355334137740000
Sheet2
Cell Formulas
RangeFormula
C4:N11C4=SUMIFS(INDEX(Sheet1!$C$3:$N$100,,XMATCH(TEXT(C$2,"mmm"),Sheet1!$C$1:$N$1)),Sheet1!$A$3:$A$100,$A$1,Sheet1!$B$3:$B$100,$A4)
 
Upvote 0
How about
Fluff.xlsm
ABCDEFGHIJKLMN
1Amaze
231/01/202328/02/202331/03/202330/04/202331/05/202330/06/202331/07/202331/08/202330/09/202331/10/202330/11/202331/12/2023
3
4Advertising3092247284911730000
5Bonus420101751584560000
6Legal000000000000
7Consulting2538135376238400000
8Rebates10492646652227560000
9Merchandise24741378717532560000
10Fees205403418300420000
11Membership14693355334137740000
Sheet2
Cell Formulas
RangeFormula
C4:N11C4=SUMIFS(INDEX(Sheet1!$C$3:$N$100,,XMATCH(TEXT(C$2,"mmm"),Sheet1!$C$1:$N$1)),Sheet1!$A$3:$A$100,$A$1,Sheet1!$B$3:$B$100,$A4)
Getting an N/A, even though I copied the formula over directly.

Book1
ABCDEFGHIJKLMN
1Jan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Oct-23Nov-23Dec-23
2CompanyCategory355624604292558
3AmazeAdvertising309224728491173
4BeyondBonus3745635458412814
5CoolAdvertising46078221176170
6BeyondLegal291165591191730
7AmazeBonus42010175158456
8AmazeConsulting253813537623840
9AmazeRebates1049264665222756
10CoolBonus781304510484047
11CoolMerchandise63476255752552
12BeyondAdvertising7325571671234829
13AmazeFees20540341830042
14AmazeMembership1469335533413774
15CoolConsulting222564216204324
16BeyondFees57283786837210
17AmazeMerchandise2474137871753256
18CoolLegal627771652793444
19BeyondRebates1317206617105446
Sheet1
Cell Formulas
RangeFormula
D1:N1D1=EOMONTH(C1,1)
 
Upvote 0
Book1
ABCDEFGHIJKLMN
1Amaze
2Jan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Oct-23Nov-23Dec-23
3
4Advertising#N/A
5Bonus
6Legal
7Consulting
8Rebates
9Merchandise
10Fees
11Membership
Sheet2
Cell Formulas
RangeFormula
C4C4=SUMIFS(INDEX(Sheet1!$C$3:$N$100,,XMATCH(TEXT(C$2,"mmm"),Sheet1!$C$1:$N$1)),Sheet1!$A$3:$A$100,$A$1,Sheet1!$B$3:$B$100,$A4)
 
Upvote 0
That's because you have changed the headers on sheet1 to dates rather than text.
Try
Excel Formula:
=SUMIFS(INDEX(Sheet1!$C$3:$N$100,,XMATCH(C$2,Sheet1!$C$1:$N$1)),Sheet1!$A$3:$A$100,$A$1,Sheet1!$B$3:$B$100,$A4)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,184
Messages
6,123,533
Members
449,106
Latest member
techog

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