SUM INDEX MATCH returning first instance

adrienne0914

Board Regular
Joined
Mar 22, 2018
Messages
73
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm hoping you can help me out. I have a question about SUM INDEX MATCH for items in a row:

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]PPTD[/TD]
[TD]PPTD[/TD]
[TD]PTD[/TD]
[TD]PTD[/TD]
[TD]PTD[/TD]
[TD][/TD]
[TD]PTD[/TD]
[TD]PPTD[/TD]
[/TR]
[TR]
[TD]Customers[/TD]
[TD]70[/TD]
[TD]81[/TD]
[TD]80[/TD]
[TD]94[/TD]
[TD]75[/TD]
[TD][/TD]
[TD]249[/TD]
[TD]151[/TD]
[/TR]
</tbody>[/TABLE]

The last two columns should total the others if there is a match to the column heading:

=SUM(INDEX($B2:$F2,MATCH(H$1,$B1:$F$1,0)))

Instead of returning the total for PTD, it just returns the first instance. What am I doing wrong?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[TD]
H
[/TD]
[TD]
I
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD][/TD]
[TD]PPTD[/TD]
[TD]PPTD[/TD]
[TD]PTD[/TD]
[TD]PTD[/TD]
[TD]PTD[/TD]
[TD][/TD]
[TD]PTD[/TD]
[TD]PPTD[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]Customers[/TD]
[TD]
70​
[/TD]
[TD]
81​
[/TD]
[TD]
80​
[/TD]
[TD]
94​
[/TD]
[TD]
75​
[/TD]
[TD][/TD]
[TD]
249​
[/TD]
[TD]
151​
[/TD]
[/TR]
</tbody>[/TABLE]

H2=SUMIF($B$1:$F$1,H$1,$B$2:$F$2) copy across
 
Upvote 0
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[TD]
H
[/TD]
[TD]
I
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD][/TD]
[TD]PPTD[/TD]
[TD]PPTD[/TD]
[TD]PTD[/TD]
[TD]PTD[/TD]
[TD]PTD[/TD]
[TD][/TD]
[TD]PTD[/TD]
[TD]PPTD[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]Customers[/TD]
[TD]
70​
[/TD]
[TD]
81​
[/TD]
[TD]
80​
[/TD]
[TD]
94​
[/TD]
[TD]
75​
[/TD]
[TD][/TD]
[TD]
249​
[/TD]
[TD]
151​
[/TD]
[/TR]
</tbody>[/TABLE]

H2=SUMIF($B$1:$F$1,H$1,$B$2:$F$2) copy across

Thank you so much! I guess I was overcomplicating things. :laugh:
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,633
Members
452,661
Latest member
Nonhle

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