how to extracts only Top of 5 records meet a value?
The following will provide you with a Top 5 list, and will take ties
into consideration...
Assumptions:
A2:A10 contains the team name
B2:B10 contains the corresponding goals
Formula:
D2: 5
This indicates that you want a Top 5 list. If, for example, you want a
Top 10 list, enter 10 instead, and so on.
E2:
=COUNTIF(B2:B10,"="&LARGE(B2:B10,D2))
F2:
=IF(ROWS(F$2:F2)<=$E$2,LARGE(B$2:B$10,ROWS(F$2:F2) ),"")
G2, copied down:
=IF($F2<"",INDEX(A$2:A$10,SMALL(IF($B$2:$B$10=$F2 ,ROW($B$2:$B$10)-ROW($B
$2)+1),COUNTIF($F$2:$F2,$F2))),"")
....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
Hope this helps!
In article ,
Son wrote:
I have a list of my football teams, but I want to calculate the number of
goal of the top last 5 teams. Please help me. Thank you.
|