Sumif Array with Index

DEHA11

New Member
Joined
Jun 25, 2018
Messages
15
I have two sheets in the same workbook. One has "Data" and the other is a "Summary".

For the sake of simplicity, lets assume the "Data" sheet looks like this:

ABCD
1JANFEBMAR
2Purchase100.00150.00225.00
3Insurance500.00500.00500.00
4Ads1,000.00750.00250.00
5Ads1,500.00500.00250.00
6Supply500.00425.00350.00
7Purchase250.00300.00550.00
8Insurance150.00150.0075.00
9Insurance75.0075.0075.00
10Supply150.00250.00300.00
11Purchase125.00225.00250.00

<tbody>
</tbody>

I'm trying to get the "Summary" sheet to update with the corresponding summed values for each month, like this:

ABCD
1JANFEBMAR
2Ads2,500.00
3Insurance725.00
4Purchase475.00
5Supply650.00

<tbody>
</tbody>

I started with =INDEX(Data!A1:D11,MATCH('Summary'!A2,Data!A2:A11,0),Match('Summary'!B1,Data!B1:D1,0))

but, of course, this only returns the first value with the matching data rather than summing all of the "matching" entries.

I changed my formula to a =SUM(IF(.... {ARRAY} and I tried a =SUM(INDEX(... formula, but neither are returning the intended result, if any.


I'd really appreciate assistance with this.

TY!!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Re: Help w/ Sumif Array w/ Index


Excel 2010
ABCDEFGHI
1JANFEBMARJANFEBMAR
2Purchase100150225Ads2,500.001,250.00500.00
3Insurance500500500Insurance725.00725.00650.00
4Ads1,000.00750250Purchase475.00675.001,025.00
5Ads1,500.00500250Supply650.00675.00650.00
6Supply500425350
7Purchase250300550
8Insurance15015075
9Insurance757575
10Supply150250300
11Purchase125225250
Sheet3
Cell Formulas
RangeFormula
G2=SUMIF($A$2:$A$11,$F2,B$2:B$11)
 
Upvote 0
Re: Help w/ Sumif Array w/ Index

Unfortunately, the formula you provided isn't quite what I am looking for. As mentioned, I simplified the "Data" sheet for simplicity, but it's much more complex. I really need a formula that will evaluate the entire "Data" sheet and return the SUM of all cells that match the 'category' in Column A and the 'month' in Row 1.
 
Upvote 0
Re: Help w/ Sumif Array w/ Index

Assuming that A2:A5 of Summary is given...

In B2 of Summary enter, copy across, and down:

=SUMIFS(INDEX(Data!$B:$D,0,MATCH(B$1,INDEX(Data!$B:$D,1,0),0)),Data!$A:$A,$A2)
 
Upvote 0
Re: Help w/ Sumif Array w/ Index

Assuming that A2:A5 of Summary is given...

In B2 of Summary enter, copy across, and down:

=SUMIFS(INDEX(Data!$B:$D,0,MATCH(B$1,INDEX(Data!$B:$D,1,0),0)),Data!$A:$A,$A2)


This is returning a result of 0 which I know is inaccurate... :(
 
Upvote 0
Re: Help w/ Sumif Array w/ Index

Both of these work:


Excel 2010
ABCDEFGHI
1JANFEBMARJANFEBMAR
2Purchase100150225Ads2,500.001,250.00500.00
3Insurance500500500Insurance725.00725.00650.00
4Ads1,000.00750250Purchase475.00675.001,025.00
5Ads1,500.00500250Supply650.00675.00650.00
6Supply500425350
7Purchase250300550
8Insurance15015075
9Insurance757575
10Supply150250300
11Purchase125225250
Sheet13 (2)
Cell Formulas
RangeFormula
G2=SUMIF($A$2:$A$11,$F2,INDEX($B$2:$D$11,,MATCH(G$1,$B$1:$D$1,0)))



Excel 2010
ABCDEFGHI
1JANFEBMARJANFEBMAR
2Purchase100150225Ads2,500.001,250.00500.00
3Insurance500500500Insurance725.00725.00650.00
4Ads1,000.00750250Purchase475.00675.001,025.00
5Ads1,500.00500250Supply650.00675.00650.00
6Supply500425350
7Purchase250300550
8Insurance15015075
9Insurance757575
10Supply150250300
11Purchase125225250
Sheet13
Cell Formulas
RangeFormula
G2=SUMPRODUCT(--($A$2:$A$11=$F2)*--($B$1:$D$1=G$1)*$B$2:$D$11)


But if your data structure is different show us where
 
Upvote 0
Re: Help w/ Sumif Array w/ Index


A
B
C
D
E
F
1
JANFEBMARDATA
2
Purchase
100​
150​
225​
3
Insurance
500​
500​
500​
4
Ads
1000​
750​
250​
5
Ads
1500​
500​
250​
6
Supply
500​
425​
350​
7
Purchase
250​
300​
550​
8
Insurance
150​
150​
75​
9
Insurance
75​
75​
75​
10
Supply
150​
250​
300​
11
Purchase
125​
225​
250​

<tbody>
</tbody>


A
B
C
D
E
F
1
JANFEBMARSummary
2
Ads
2500​
1250​
500​
3
Insurance
725​
725​
650​
4
Purchase
475​
675​
1025​
5
Supply
650​
675​
650​

<tbody>
</tbody>

Summary

B2=
SUMPRODUCT((Data!$A$2:$A$11=Summary!$A2)*(Data!$B$1:$D$1=Summary!B$1)*(Data!$B$2:$D$11)) copy across and down
 
Upvote 0
Re: Help w/ Sumif Array w/ Index



B2=
SUMPRODUCT((Data!$A$2:$A$11=Summary!$A2)*(Data!$B$1:$D$1=Summary!B$1)*(Data!$B$2:$D$11)) copy across and down


I triple checked that all of the cell references are correct, but this formula is not working either.
 
Upvote 0

Forum statistics

Threads
1,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

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