INDEX MATCH two criteria with SUMIF

vostroxe

New Member
Joined
Jul 13, 2018
Messages
29
Hello,

Does anyone know on how to combine SUMIF with INDEX MATCH. I have an issue whereby my lookup only identify first result that is in Sample C2. My intention that my formula will sum all the figure in column C i.e 700,000. My lookup value need to be maintain on Account number & Item no.

Sample

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Co Code[/TD]
[TD]Account Number[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]9099[/TD]
[TD]2170100[/TD]
[TD]659,000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]9099[/TD]
[TD]2170100[/TD]
[TD]2,300[/TD]
[TD]700[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]9099[/TD]
[TD]2170100[/TD]
[TD]38,700[/TD]
[TD]56[/TD]
[/TR]
</tbody>[/TABLE]

My result using below formula.

=INDEX(Sample!A2:C4,MATCH(A2,Sample!B1:B4,0),MATCH(B2,Sample!C1:C2,0))

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Account Number[/TD]
[TD]Item[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2170100[/TD]
[TD]1[/TD]
[TD]659,000[/TD]
[/TR]
</tbody>[/TABLE]


Intended result


[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Account Number[/TD]
[TD]Item[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2170100[/TD]
[TD]1[/TD]
[TD]700,000[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]3[/TD]
[TD]2170100[/TD]
[TD]2[/TD]
[TD]756[/TD]
[/TR]
</tbody>[/TABLE]


****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">ABC1Account NumberItemAmount221701001700,000
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
How about


Book1
ABCD
1Co CodeAccount Number12
290992170100659,0000
3909921701002,300700
49099217010038,70056
5
6
11
12
13
14Account NumberItemAmount
1521701001700,000
1621701002756
Sheet4
Cell Formulas
RangeFormula
C15=SUMIF($B$2:$B$4,A15,INDEX($C$2:$D$4,,MATCH(B15,$C$1:$D$1,0)))
 
Upvote 0
Try


[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][td="bgcolor: #DCE6F1"]
D
[/td][td="bgcolor: #DCE6F1"]
E
[/td][td="bgcolor: #DCE6F1"]
F
[/td][td="bgcolor: #DCE6F1"]
G
[/td][td="bgcolor: #DCE6F1"]
H
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Co Code​
[/td][td]
Account Number​
[/td][td]
1​
[/td][td]
2​
[/td][td][/td][td]
Account Number​
[/td][td]
Item​
[/td][td]
Amount​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
9099​
[/td][td]
2170100​
[/td][td]
659000​
[/td][td]
0​
[/td][td][/td][td]
2170100​
[/td][td]
1​
[/td][td]
700000​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
9099​
[/td][td]
2170100​
[/td][td]
2300​
[/td][td]
700​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
9099​
[/td][td]
2170100​
[/td][td]
38700​
[/td][td]
56​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


Formula in H2
=SUMIF($B:$B,F2,INDEX($A:$D,0,MATCH(G2,$A$1:$D$1,0)))

M.
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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