Combine XLOOKUP and RANK to create ranked dynamic table from static alphabetical table?

chasfh

Board Regular
Joined
Dec 10, 2014
Messages
65
Office Version
  1. 365
Platform
  1. Windows
I have a static table of players in alphabetical order with scores and ranks. I want to create a dynamic second table that reflects the same table in ranked order of points.

My first instinct is that it would combine XLOOKUP and RANK into a single command, but that may not be the way to go, because I am coming up dry when I google around for such a command.

Here is the table in alphabetical order:

PlayerScoreRank
Barrett, S8411
Clark, R868
Duski, M868
Eikenberry, J8411
Helseth, T893
Hopper, B893
Hultquist, B893
James, B893
Kay, G893
Michel, G8510
Muntz, R941
Rankin, T8314
Rosen, R8411
Stephens, C941
Tellman, M8215

The result would look something like this:

PlayerScoreRank
Muntz, R941
Stephens, C941
Helseth, T893
Hopper, B893
Hultquist, B893
James, B893
Kay, G893
Clark, R868
Duski, M868
Michel, G8510
Barrett, S8411
Eikenberry, J8411
Rosen, R8411
Rankin, T8314
Tellman, M8215

The main conditions for this new table must be these:
  • It has to be dynamic so that when scores and ranks change, this second table reflects the new rankings, changing the order of players listed as appropriately ranked.
  • When there is a tie score between or among multiple records, all the tied players must show in the table. For example, there is a five-way tie for third on the example table—in the dynamic table result, all five players must be reflected, as opposed to the same player showing up five times.
Is this possible to do?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try this:
Excel Formula:
=SORT(A2:C16, 2, -1)
or this if you want ties in alphabetical order:
Excel Formula:
=SORT(A2:C16,{2,1},{-1,1})
1734903350079.png
 
Upvote 0
Power Query Solution

Book8
ABCDEFG
1PlayerScoreRankPlayerScoreRank
2Barrett, S8411Muntz, R941
3Clark, R868Stephens, C941
4Duski, M868Helseth, T893
5Eikenberry, J8411Hopper, B893
6Helseth, T893Hultquist, B893
7Hopper, B893James, B893
8Hultquist, B893Kay, G893
9James, B893Clark, R868
10Kay, G893Duski, M868
11Michel, G8510Michel, G8510
12Muntz, R941Barrett, S8411
13Rankin, T8314Eikenberry, J8411
14Rosen, R8411Rosen, R8411
15Stephens, C941Rankin, T8314
16Tellman, M8215Tellman, M8215
Sheet1



Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Sorted Rows" = Table.Sort(Source,{{"Score", Order.Descending}})
in
    #"Sorted Rows"

any changes to the source document will dynamically update the output when you select Data-->Refresh Data
 
Upvote 0
Or if you need to include rank in the formula:
Excel Formula:
=LET(
    a, A2:A16,
    b, B2:B16,
    c, RANK.EQ(--b, b),
    SORT(HSTACK(a, b, c), {2, 1}, {-1, 1})
)
1734904333954.png
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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