SORT Function in Excel

Intermediate

Sorts the contents of a range or array.

Syntax

=SORT(array, [sort_index], [sort_order], [by_col])

Example

Use Case

Sort a table of data alphabetically.

Common Errors to Avoid

  • Only available in Microsoft 365 and Excel 2021+
  • #SPILL! error if output area already has data
  • sort_index counts from 1 (first column/row of array)

Pro Tips

Use sort_order=1 for ascending, -1 for descending. Sort by multiple columns using SORTBY instead. Ensure adequate space for spill array. Combine with FILTER for sorted, filtered results.

Need help with this formula?

Our AI Formula Generator can write this for you instantly.

Try AI Formula Generator →
SORT Function in Excel | Excel AI Tools