Top 5 formula

Pizzio

Active Member
Joined
Apr 28, 2005
Messages
268
Is there a way to create a formula in excel that pulls from a column the top/bottom 5 entries out of 100 items? I've been working on this for a day now.
 
I've used the following formula for my ranks:

=RANK(AC12,$AC$12:$AC$55,0)

where AC12:AC55 are the indivdual "scores." I then used the following to list my top 5:

=IF(ROW()-ROW($L$2)<=$L$1,INDEX($AB$12:$AB$55,MATCH(ROW()-ROW($L$2),$AD$12:$AD$55,0)),"")

where L1="5" and the top 5 are listed in L3:L7 and AB12:AB55 are the individual's names.

This works well except it does not account for ties at any position. I'd like the top 5 to list as follows:

1. Joe (ranked 1, score 5)
2. Tim (ranked 2, score 3)
2. Sue (ranked 2, score 3)
4. Jim (ranked 4, score 2)
4. Jon (ranked 4, score 2)

Is there an easy method of accomplishing this? Items in parentheses are not required. Thanks for all the help!
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Sanador said:
I've used the following formula for my ranks:

=RANK(AC12,$AC$12:$AC$55,0)

where AC12:AC55 are the indivdual "scores." I then used the following to list my top 5:

=IF(ROW()-ROW($L$2)<=$L$1,INDEX($AB$12:$AB$55,MATCH(ROW()-ROW($L$2),$AD$12:$AD$55,0)),"")

where L1="5" and the top 5 are listed in L3:L7 and AB12:AB55 are the individual's names.

This works well except it does not account for ties at any position. I'd like the top 5 to list as follows:

1. Joe (ranked 1, score 5)
2. Tim (ranked 2, score 3)
2. Sue (ranked 2, score 3)
4. Jim (ranked 4, score 2)
4. Jon (ranked 4, score 2)

Is there an easy method of accomplishing this? Items in parentheses are not required. Thanks for all the help!

Recap...
aaTopN Sanador.xls
KLMN
15
22
3Top 5
4joe
5tim
6sue
7dawn
8john
9jim
10jon
11 
Data
aaTopN Sanador.xls
ABACADAE
10
11NameScoreRank
12dawn24
13damon18
14bob19
15chris012
16christine110
17ian111
18john25
19joe51
20tim32
21jim26
22jon27
23sue33
Data


L1: 5

L2:

=MAX(IF(INDEX(AC12:AC55,MATCH(L1,AD12:AD55,0))=AC12:AC55,AD12:AD55))-L1

which is confirmed with control+shift+enter.

L4, copied down:

=IF(ROW()-ROW($L$4)+1<=$L$1+$L$2,INDEX($AB$12:$AB$55,MATCH(ROW()-ROW($L$4)+1,$AD$12:$AD$55,0)),"")

AD12, copied down:

=RANK(AC12,$AC$12:$AC$55)+COUNTIF($AC$12:AC12,AC12)-1
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,821
Members
449,340
Latest member
hpm23

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