Excel 365 + Google Sheets · SORT
A ranking that sorts itself
Returns your table sorted by any column, and re-sorts when numbers change.
The formula
=SORT(A2:B5, 2, -1)What each part means
A2:B5What to sort2By the 2nd column-1Highest first
Example
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Sales | Rep | Sales | |
| 2 | Laura | 1,250 | |||
| 3 | João | 980 | |||
| 4 | Priya | 2,410 | |||
| 5 | Tom | 640 |
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Sales | Rep | Sales | |
| 2 | Laura | 1,250 | Priya | 2,410 | |
| 3 | João | 980 | Laura | 1,250 | |
| 4 | Priya | 2,410 | João | 980 | |
| 5 | Tom | 640 | Tom | 640 |
Step by step
- Click cell D2.
- Type the formula:
=SORT(A2:B5, 2, -1) - Press Enter.
- The results fill the cells below by themselves (it’s a dynamic array formula). Don’t type anything in them.
Where it works
- Excel 365 and Excel 2021 or newer
- Google Sheets
- Excel for the web (free)
The same formula in other languages
- English SORT
- Español ORDENAR
- Português CLASSIFICAR