Ranking list by value and corresponding name

mprusak

New Member
Joined
May 5, 2003
Messages
36
I would like to take a list of names and values and have the list recreated on another sheet in descending order according to the value.

As an example:
(This list would be limited to 12 names/values)
A B
Smith 35.00
Jones 1.00
Davis 45.00

Desired result:
Davis 45.00
Smith 35.00
Jones 1.00

The best I have been able to do to this point, is get the numbers ranked using the BIG formula. I do not know how to assign the corresponding name to those values. Also, FWIW, many of the values may end up being identicle.

I need this to continue to update as the names are added to the list. The names my be added in any order from 1-12. In other words, the first name may be added to the 9th spot with a value of 2.00. (At this time, the ranked list should show this name in the first spot) The next name may be entered in the 3rd spot with a value of 70.00. (Now the list should have this name in the first spot and the previous in the second spot...)

I hope this is clear...I am trying to be as detailed as possible. I apprecaite any help.

Thanks,
Mark
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Book5
ABCDEFGH
1NameValueRank3NameValue
2Smith35.002Davis45.00
3Jones1.003Smith35.00
4Davis45.001Jones1.00
5
6
Sheet1


Formulas...

C2:

=RANK(B2,$B$2:$B$4)+COUNTIF($B$2:B2,B2)-1

E1:

=MAX(C2:C4)

F2:

=IF(ROW()-ROW($F$1)<=$E$1,INDEX($A$2:$A$4,MATCH(ROW()-ROW($F$1),$C$2:$C$4,0)),"")

G2:

=IF(F2<>"",INDEX($B$2:$B$4,MATCH(ROW()-ROW($F$1),$C$2:$C$4,0)),"")
 
Upvote 0
All I can say is WOW...

Thank you for the quick response...the formulas work perfectly.

Would it be asking too much if you can walk me thru the logic of the last two formulas (F2 and G2)?

Thanks again,

Mark.
 
Upvote 0
mprusak said:
...Would it be asking too much if you can walk me thru the logic of the last two formulas (F2 and G2)?...

In the formula in F2...

=IF(ROW()-ROW($F$1)<=$E$1,INDEX($A$2:$A$4,MATCH(ROW()-ROW($F$1),$C$2:$C$4,0)),"")

ROW() gives the row num of the cell that houses this formula. Since it's F2, we get 2.

ROW()-ROW($F$1) ==> 1

Since 1 < the value in $E$1, the INDEX part is evaluated:

The Match bit looks up ROW()-ROW($F$1), that is, 1 in $C$2:$C$4, and returns the position of 1 in $C$2:$C$4, which is 3 (that's the 3rd cell of $C$2:$C$4). INDEX fetches the 3rd value from $A$2:$A$4 which is Davis.

The formula in G2 has the same logic. Its INDEX part is run if F2 is not blank (F2<>"").
 
Upvote 0
I think that works. Thanks. But I still have heard of an array formula to do the trick. I don't know if it is a standard Excel function or some custom built one. I think it is either called the "Sortarray" or the "Arraysort" function. I think here you simply reference the original array and then specify how and by what you want it sorted. Then in the formula array part, the listed shows up sorted and changes if the original list changes as well.
 
Upvote 0

Forum statistics

Threads
1,215,018
Messages
6,122,703
Members
449,093
Latest member
Mnur

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