sum top 5 base on one condition

L

luvgreen

Hi Experts. I need your advise on how to sum top 5 base on one condition, say
sum top 5 of A. It should be 10+12+7+4+2 = 35. Thanks much!!!
A 1
A 2
C 3
A 4
B 5
A 7
D 9
A 10
A 12
 
P

Peo Sjoblom

One possible way

=SUM(LARGE(IF(A1:A9="A",B1:B9),{1;2;3;4;5}))

entered with ctrl + shift & enter

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey
 
L

luvgreen

Thank you much. I posted twice because I thought I did not post succeesfully
first time. Yes, it worked.
 
Top