Skip to content
ExcelExcel 2021+

SORT function in Excel

Sorts the contents of a range or array

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

SORT syntax and parameters

Four arguments, one required.

  • arrayarrayRequired

    The range, or array to sort

  • sort_indexnumberOptional

    A number indicating the row or column to sort by

  • sort_ordernumberOptional

    A number indicating the desired sort order; 1 for ascending order (default), -1 for descending order

  • by_colbooleanOptional

    A logical value indicating the desired sort direction; FALSE to sort by row (default), TRUE to sort by column

SORT examples

Formulas you'll actually reuse.

  1. Whole table by its third column, biggest deals first (-1 = descending):

    =SORT(A2:C200, 3, -1)
  2. Filter then sort — the spilled result stays live as data changes:

    =SORT(FILTER(A2:C200, C2:C200 > 1000), 3, -1)

SORT in Google Sheets

Same name — your formula ports as-is.

Try SORT in the playground

Edit the example — nothing to install.

Preloaded with the SORT formula from Example 1 — change anything and watch it respond.

Loading the editor…