SORT
Dynamic arraysMicrosoft 365Return a range sorted — results spill, source untouched.
Syntax
SORT(array, [sort_index], [sort_order], [by_col])
Arguments
- array
- The range to sort.
- sort_indexoptional
- Which column (or row) to sort by. Default 1.
- sort_orderoptional
- 1 ascending (default), -1 descending.
- by_coloptional
- TRUE to sort columns instead of rows.
Examples
=SORT(FILTER(Data, Region=A2), 3, -1)
→ matching rows, biggest first
Related functions
More Dynamic arrays functions
Syntax follows Microsoft’s documentation. Examples are written to be pasted into a cell and checked. Argument separators may be ; in your locale. The AI explainer runs on a free community model — verify anything important.