Index to return a sum of corresponding matching rows

alex1alex

Board Regular
Joined
Sep 12, 2014
Messages
57
FruitNumberSum
Apple10=16
Apple6=16
Pear1=1

<tbody>
</tbody>

Hello,

Im trying to do an index formula that will give me the SUM column.
Look up the fruit on this row, then add up all the corresponding numbers for that fruit.

I keep looking at index examples...from the description it sounds like that's possible but I'm not getting anywhere.

Is this possible? How would you do that?

Many Thanks,
Alex
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
=SUMIF(B1:B3,"Apple",A1:A3)

INDEX returns an individual cell.

in D1 put Apple
in D2 put Pear

in E1
=SUMIF($B1:$B3,D1,$A1:$A3)
copy down to D2
 
Upvote 0
:eek: This is my embarrassed face.


Thanks Special-K.

(As an aside, in the end I can just use A1 instead of the D1 since I want % of Apples/Bananas. IE, =B1/Sumif($B1:$B3,A1,$A1:$A3). I guess I should have column B Number of Sub-Type instead of just number.)
 
Upvote 0
just noticed the SUMIF formula's above have switched the RANGE and Sum_range fields ....... it's supposed to be SUMIF(range, criteria, [sum_range])....

SO, for that last example....it's:

=B1/Sumif($A1:$A3, A1, $B1:$B3)


(just in case someone runs across this...don't want them to be confused :)
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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