Forum Discussion

Iceberg's avatar
Iceberg
Copper Contributor
May 01, 2026
Solved

Identifying the highest values from multiple sources

I'm working on putting together seasonal statistics from a sporting league (Cricket). 

One of the stats I need is each player's highest individual score from the season, but with more than 300 players in the League, manually finding each player's top score during the season is not practical.

So far I have used "sortby" to produce an alphabetical list of each player and their individual scores from the season in descending order. I have a small example below of where I am.

PlayerScoresNot Out
Player A660
Player A470
Player A450
Player A420
Player A330
Player A180
Player A140
Player A110
Player A50
Player A40
Player A40
Player A20
Player A10
Player A00
Player B70
Player B40
Player B30
Player B20
Player B21
Player B10
Player B00
Player B00
Player B00
Player B01
Player C1051
Player C500
Player C310
Player C230
Player D970
Player D940
Player D690
Player D690
Player D200
Player D150
Player D130
Player D110
Player D100
Player D70
Player D20
Player D00
Player D00

Now I just want extract each player's highest score from the season, so that I end up with just the top score for each player.

What I am trying to end up with from the above array would look like the following

Player Scores Not Out

PlayerScoresNot Out
Player A660
Player A50
Player C1051
Player D970
I've tried the 'Unique' Formula, but no luck.
 
  • Transform your scores data into a structured table and apply this formula. Let's say you call it "Table1". Make sure it's sorted (Player, ascending order and Score and Not Out both in descending order.

    =LET(
    players, UNIQUE(Table1[Player]),
    score, XLOOKUP(players,Table1[Player],Table1[Scores]),
    notout, XLOOKUP(players,Table1[Player],Table1[Not Out]),
    HSTACK(players, score, notout)
    )

     

2 Replies

  • IlirU's avatar
    IlirU
    Iron Contributor

    Hi Iceberg​,

    Try this formula:

    =LET(
         gb, GROUPBY(A2:A42, B2:B42, MAX,, 0),
             VSTACK(A1:C1, HSTACK(gb, BYROW(gb,
             LAMBDA(a, XLOOKUP(TRUE, BYROW(a = A2:B42, AND), C2:C42)))))
    )

    HTH.

    IlirU

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Transform your scores data into a structured table and apply this formula. Let's say you call it "Table1". Make sure it's sorted (Player, ascending order and Score and Not Out both in descending order.

    =LET(
    players, UNIQUE(Table1[Player]),
    score, XLOOKUP(players,Table1[Player],Table1[Scores]),
    notout, XLOOKUP(players,Table1[Player],Table1[Not Out]),
    HSTACK(players, score, notout)
    )