Sort any range with a formula — results update automatically when your data changes.
SORT returns a sorted copy of a range as a spilled array. Unlike clicking the Sort button, the formula result updates live — add a row to your source data and the sorted output rearranges itself automatically.
SORT(array, [sort_index], [sort_order], [by_col])| Argument | What it means |
|---|---|
| array required | The range to sort. |
| sort_index optional | Which column (or row) to sort by. 1 = first column (default). |
| sort_order optional | 1 = ascending (default), -1 = descending. |
| by_col optional | FALSE (default) = sort rows. TRUE = sort columns. |
Sort A2:C50 by the first column, A to Z:
=SORT(A2:C50)Sort the same range by the third column, highest to lowest:
=SORT(A2:C50, 3, -1)Sort by Region (column 1) ascending, then by Amount (column 3) descending:
=SORT(A2:C50, {{1,3}}, {{1,-1}})Pass arrays of column numbers and sort orders, wrapped in curly braces, to sort by multiple columns at once.
Sort filtered results — first filter to "North" region, then sort by Amount descending:
=SORT(FILTER(A2:C100, B2:B100="North"), 3, -1)SORT sorts by a column inside the array itself. SORTBY sorts one range based on a separate column — useful when you want to sort data but the sort key is in a different range.
Type it in a live spreadsheet, get instant feedback. No videos, no downloads.
Start practising free →