please give me a hint on how to make this table.
Turn | Player | Points |
---|---|---|
1 | Player1 | 10 |
2 | Player3 | 15 |
3 | Player1 | 22 |
4 | Player6 | 10 |
...and so on. Basically, each turn some player earns some points. We don't know the number of players until the end, so I can't just make a list of players aside and SUMIF their points. I only need to find the WINNER, a player with the maximum amount of points, i.e. in this table it would be Player1 with 10 22=32 points. I only need one cell with WINNER: Player7
Is there a nice solution for this?
I'm using Excel 365, but vba is not allowed.
CodePudding user response:
With Office 365:
=LET(
ply,B2:B5,
pts,C2:C5,
unq,UNIQUE(ply),
INDEX(SORTBY(unq,SUMIFS(pts,ply,unq),-1),1,1))
CodePudding user response:
I would start by limiting the size of the table, e.g. to 500 rows.
You could make it a million rows, but it will slow the calculation
- Title Column D "Cumulative Points".
- In cell D2 enter "
=SUMIF(B$2:B2,B2,C$2:C2)
" and copy it down the column to 500 rows
In cell D3, this will become "=SUMIF(B$2:B3,B3,C$2:C3)
" etc. - Title Column E "Player"
- In cell E2 write "
= B2
" and copy it down 500 rows - Title Column G "Winner"
- In cell G2 write "
=VLOOKUP(MAX(D$2:D$500),$D$2:$E$500,2,FALSE)
" - Hide columns D and E