What SORT does
SORT rearranges a range or array into ascending or descending order without changing the source data. It is especially useful in dynamic reports where the sorted output should update automatically as the data changes.
Practical examples
Sort a table by the third column
=SORT(A2:C10,3,1)
This sorts the rows in A2:C10 by the values in the third column in ascending order.
Sort a list in descending order
=SORT(A2:A20,1,-1)
This returns the values from A2:A20 from highest to lowest or from Z to A, depending on the data type.
Common mistakes and notes
sort_index is relative to the selected array
If you sort A2:C10, then 3 means the third column within that selection, not column C on the whole worksheet.
SORT also spills results
Like other dynamic array functions, SORT needs empty cells for the full result. Otherwise Excel may return #SPILL!.
Use SORTBY when the sort key is outside the array
SORT works best when the sort column is inside the selected array. If the sort key lives elsewhere, SORTBY is usually the better choice.