You sort a leaderboard by score, then someone’s score changes and the order is wrong again. The Sort button sorts once; the SORT function sorts live. Point it at the data and it spills a sorted copy that re-sorts itself every time a value changes — the leaderboard stays correct without anyone touching it.
What SORT does
SORT takes a range and returns it sorted by a column you choose, ascending or descending. The result spills into neighbouring cells, so you need empty space below and to the right. The original data never moves — SORT shows a sorted view of it, which means the source stays in entry order while every report built on it stays sorted.
The syntax
=SORT(array, [sort_index], [sort_order], [by_col])
- array — the range to sort, for example A2:C10.
- sort_index — which column to sort by, counting from 1. Default is 1.
- sort_order — 1 for ascending (A to Z, small to large), -1 for descending.
- by_col — FALSE sorts by rows (the usual case); TRUE sorts by columns.
Step-by-step example
Sort this leaderboard by score, highest first.
- Click an empty cell where the sorted copy should start — make sure the cells below and right are empty.
- Type
=SORT(A2:C9,3,-1)— sort the range by column 3 (Score), descending. - Press Enter. The sorted table spills below, highest score first.
- Change a score in the source data and watch the spilled table re-sort itself instantly.
- To sort by name instead, change the sort index:
=SORT(A2:C9,1,1)sorts by column 1, ascending.
Worked example
| Name | Region | Score |
|---|---|---|
| Mina | East | 92 |
| Jae | West | 58 |
| Sora | East | 77 |
| Tom | North | 84 |
=SORT(A2:C5,3,-1) returns Mina 92, Tom 84, Sora 77, Jae 58 — the same rows, re-ordered by score. Edit any score and the order updates without a single click.
Common errors
#SPILL! — the result has nowhere to go. Something is already in the cells the sorted result needs. Clear the area below and to the right of the formula cell, including cells that look empty but contain a space.
Numbers sort like text. Scores stored as text sort as 100, 20, 9 — alphabetically. Convert them to real numbers first, or the order will look random.
Only one column came out sorted. The array argument covered one column instead of the whole table. Include all columns in the range so each row stays together.
The sort does not update. You used the Sort button, not the SORT function. The button is a one-time action; only the function re-sorts when data changes.
Tip
SORT pairs well with FILTER: =SORT(FILTER(A2:C9,B2:B9=”East”),3,-1) shows the East region sorted by score, live. And SORTBY lets you sort by a column that is not in the result — handy for leaderboards that hide the sort key.
Top 3 without sorting everything
For a top-3 list, wrap SORT in TAKE: =TAKE(SORT(A2:C9,3,-1),3) returns only the first three rows of the sorted result. TAKE and DROP are the natural partners of SORT — TAKE keeps the top N, DROP skips the first N, so a “positions 4 to 6” view is =DROP(TAKE(SORT(A2:C9,3,-1),6),3). These three functions together replace most of the manual copying people do to build ranked lists, and the whole chain stays live when scores change.
Practice file
Download the SORT practice file (.xlsx) — it contains a leaderboard with a live SORT formula, a top-3 version with TAKE, and a blank sheet for you to try it yourself.
Google Sheets
Google Sheets has SORT with the same syntax, and it also spills live results. One Sheets difference: the spilled range shows a small warning icon if anything blocks it, which makes #SPILL!-style problems easier to spot.
Example prices and figures are illustrative, not market data.