Sorting a two column table using SORTBY and if values are identical, use a table to rank them

Occasional Reader

Hi,
I have a two-column table with "Name" and "Points". To sort this table, I use the SORTBY function and that works as I would like it to do. However, if two or more persons have the same number of points I would like to sort the person with the highest ranking before next one. The ranking information is in another (two column) table. I'm struggling to find a solution to do this (without VBA). If anyone has an idea how I can solve this or point me in a direction it will be much appreciated.

2 Replies

Hi @espensun 

 

Seems to do it... (used Tables - not mandatory):

Sample.png

=LET(
  ranks,    XLOOKUP( Points[Name], Ranks[Name], Ranks[Rank] ),
  stacked,  HSTACK( Points, ranks ),
  sorted,   SORTBY( stacked, Points[Points], -1, ranks, -1 ),
  DROP( sorted,, -1)
)

Thank you so much for your reply @Lorenzo. I'll give that a go👍