Sort Players By Win Stat

Copper Contributor

Hi there, I'm a pretty basic user when it comes to Excel. I'm currently trying to create a leaderboard that automatically sorts players in descending order based on their win rate.

 

The aim is I manually adjust their games played and wins, which (currently does) automatically adjust their win rates, and then their names automatically sort with the row of cells that contains that players information.

 

Attached is an example of the data I'd like to sort. In this example, "Alf" should automatically go to the top of the list, since he has the highest win rate. "Greg" should automatically go to second from the top, and "Guy" should move to the bottom.

 

Does anyone have a solution for this? I've tried looking it up but to no avail.

1 Reply

@BenW95 This would require a small piece of Visual Basic code that runs every time something changes in your worksheet. In the attached workbook, I've added such a "Worksheet_change" event code. Right-click in the tab name for Sheet and press "View code" to have a look.

 

But first, I transformed the your ranking list to a structured Excel table, called Table1. This also puts filter buttons in the header row, which allows the code to re-sort the list, every time something changes anywhere within Sheet1.