Returning the Highest values in a column

pablorynx

New Member
Joined
Nov 22, 2003
Messages
3
Imagine two columns of cells, one containing text, the other containing values.
In the first cells of the third column, I want to display the four largest values from the second column.
In the first cells of the fourth column, I want to display the names associated with those values.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
pablorynx said:
Imagine two columns of cells, one containing text, the other containing values.
In the first cells of the third column, I want to display the four largest values from the second column.
In the first cells of the fourth column, I want to display the names associated with those values.
Top4.xls
ABCDE
114
2NameScoreRankTop4Y
3dawn234john35
4damon235ian32
5bob253bob25
6chris226dawn23
7christine217damon23
8ian322  
9john351  
Data


Formulas...

D1:

=MAX(IF(INDEX(B3:B9,MATCH(E1,C3:C9,0))=B3:B9,C3:C9))-E1

which must be confirmed with control+shift+enter instead of just with enter.

D3:

=IF(E3<>"",INDEX($A$3:$A$9,MATCH(ROW()-ROW($D$3)+1,$C$3:$C$9,0)),"")

E3:

=IF(ROW()-ROW($E$3)+1<=$E$1+$D$1,INDEX($B$3:$B$9,MATCH(ROW()-ROW($E$3)+1,$C$3:$C$9,0)),"")
 
Upvote 0
Aladin Akyurek said:
...

Formulas...

D1:

=MAX(IF(INDEX(B3:B9,MATCH(E1,C3:C9,0))=B3:B9,C3:C9))-E1

which must be confirmed with control+shift+enter instead of just with enter.

D3:

=IF(E3<>"",INDEX($A$3:$A$9,MATCH(ROW()-ROW($D$3)+1,$C$3:$C$9,0)),"")

E3:

=IF(ROW()-ROW($E$3)+1<=$E$1+$D$1,INDEX($B$3:$B$9,MATCH(ROW()-ROW($E$3)+1,$C$3:$C$9,0)),"")

The formula in C3, in case the exhibit gets unreadable, is:

=RANK(B3,$B$3:$B$9)+COUNTIF(B3:$B$3,B3)-1
 
Upvote 0
Okay, trying to follow all of this

=MAX(IF(INDEX(B3:B9,MATCH(E1,C3:C9,0))=B3:B9,C3:C9))-E1

Where B is my list of numbers (I need the top 20). But what is E1 and the C Range?
 
Upvote 0
Okay, trying to follow all of this

=MAX(IF(INDEX(B3:B9,MATCH(E1,C3:C9,0))=B3:B9,C3:C9))-E1

Where B is my list of numbers (I need the top 20). But what is E1 and the C Range?

In your case, you enter 20 in E1.

C-range (C3:C9) is the range where scores/values from B3:B9 are ranked.
 
Upvote 0
Okay, so I am breaking this all down and appreciate the help.

However, when I try to rank my data, I am still getting duplicates.

If you take the Rank command and just rank the two cells (using your above example) for 23 ... both will return the same rank. One rank 23 is not higher or lower than the other rank 23, therefore the countif command is actually useless (since it is counting both 23's and subtracting 1, therefore it is a constant).

The problem is getting it to rank the first 23 as the 4th and the second 23 as the 5th. Am I getting a different result than yours or missing a step here somewhere? I believe that the rank command is the first step of the entire sheet.
 
Upvote 0
Okay, so I am breaking this all down and appreciate the help.

However, when I try to rank my data, I am still getting duplicates.

If you take the Rank command and just rank the two cells (using your above example) for 23 ... both will return the same rank. One rank 23 is not higher or lower than the other rank 23, therefore the countif command is actually useless (since it is counting both 23's and subtracting 1, therefore it is a constant).

The problem is getting it to rank the first 23 as the 4th and the second 23 as the 5th. Am I getting a different result than yours or missing a step here somewhere? I believe that the rank command is the first step of the entire sheet.

1. Try either to rebuild the case discussed in this thread until you obtain the same results as the exhibit shows in order to secure an understanding of the steps involved...

2. Or to provide a small sample from your data.
 
Upvote 0

Forum statistics

Threads
1,215,335
Messages
6,124,327
Members
449,155
Latest member
ravioli44

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