Lookup & Reference
Modern
SORT
Returns a range sorted by one or more columns.
Available in Microsoft 365 · Excel 2024 · Excel 2021 · Excel for the web. Not in 2019/2016.
Syntax
SORT(array, [sort_index], [sort_order], [by_col])What it returns
A spilled array of the sorted data.
Arguments
| Argument | Required | Description |
|---|---|---|
array |
Yes | The range to sort. |
sort_index |
No | Which column (or row) to sort by (default 1). |
sort_order |
No | 1 = ascending (default), -1 = descending. |
by_col |
No | FALSE = sort rows (default), TRUE = sort columns. |
Example
Source
| A | B | C | |
|---|---|---|---|
| 1 | Region | Sales | |
| 2 | North | 1200 | |
| 3 | South | 800 | |
| 4 | East | 1500 | |
| 5 | West | 600 | |
| 6 |
→
Result
| A | B | C | |
|---|---|---|---|
| 1 | Region | Sales | |
| 2 | East | 1500 | |
| 3 | North | 1200 | |
| 4 | South | 800 | |
| 5 | West | 600 | |
| 6 |
=SORT(A2:B5, 2, -1)Important to know
Spills into multiple cells.
Returns a sorted copy — the source is unchanged.
Use SORTBY to sort by a column you don't display.
365 / 2021+ only.
Related learning
No MEE lesson covers this function yet.


