LeaderboardHQ

Google Sheets Leaderboard

Creating a leaderboard in Google Sheets is an easy way to keep score and show rankings in a way that can be shared with others and allow for multiple collaborators.

To get started, create a new Google Sheet.

Set up your Sheets leaderboard as shown in the screenshot below: A name column and a score column. Google Sheets Leaderboard Setup

From here you can add names and scores, incrementing scores with each round.

Spreadsheet apps like Google Sheets and Microsoft Excel allow you to use their built-in sort functions, which would allow you to re-sort your spreadsheet each time you add or change data.

To make it easier, we can add a script in Google Sheets to have the leaderboard spreadsheet re-sort automatically.

Choose Tools > Script Editor in Google Sheets.

In the script editor, paste the following script:

SHEET_NAME = "Sheet1"; SORT_DATA_RANGE = "A1:B999"; SORT_ORDER = [ {column: 2, ascending: false}, // 3 = column number, sorting by descending order {column: 1, ascending: true} // 1 = column number, sort by ascending order ]; function onEdit(e){ multiSortColumns(); } function multiSortColumns(){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName(SHEET_NAME); var range = sheet.getRange(SORT_DATA_RANGE); range.sort(SORT_ORDER); ss.toast('Sort complete.'); }

Save the script. You may need to choose the Run option and authorize your account to run your script.

Go back to your spreadsheet and add or update scores. You should see your Google Spreadsheet leaderboard re-sort based on the new data.

From here, you can share your sheet with others to allow for viewing and editing.

For greater ease of use and additional features, create a free leaderboard with LeaderboardHQ.