Sep 27 2020 10:53 AM
Hey everyone, would appreciate any help you can provide.
Trying to sort scores from highest to lowest and then return the corresponding name values in sorted order. For example, Team 1 has 10 points, Team 2 has 11 points, Team 3 has 5 points. I want it to sort Team 2, Team 1, Team 3.
Having more trouble than I expected. Thanks in advance!
Sep 27 2020 11:34 AM
Solution
Here is a solution using two helper columns:
C4 contains the formula
=RANK(B4,$B$4:$B$9)+COUNTIF(B$4:B4,B4)-1
This is filled down to C9. The formula returns the rank, breaking ties (note the different rank for Team 4 and Team 5).
E4 to E9 contain the numbers 1 to 6.
The formulas in F4 and G4 are
=INDEX($A$4:$A$9,MATCH(E4,$C$4:$C$9,0))
and
=INDEX($B$4:$B$9,MATCH(E4,$C$4:$C$9,0))
respectively. These are filled down to F9 and G9.
See the attached sample workbook.
Sep 27 2020 11:41 AM
@Hans Vogelaar Makes so much sense, thank you for you help!!!
Sep 27 2020 11:34 AM
Solution
Here is a solution using two helper columns:
C4 contains the formula
=RANK(B4,$B$4:$B$9)+COUNTIF(B$4:B4,B4)-1
This is filled down to C9. The formula returns the rank, breaking ties (note the different rank for Team 4 and Team 5).
E4 to E9 contain the numbers 1 to 6.
The formulas in F4 and G4 are
=INDEX($A$4:$A$9,MATCH(E4,$C$4:$C$9,0))
and
=INDEX($B$4:$B$9,MATCH(E4,$C$4:$C$9,0))
respectively. These are filled down to F9 and G9.
See the attached sample workbook.