SORT

Returns a range which is sorted based on values in one or more columns.

Syntax

SORT(range; sortColumn1; sortOrder1; …; sortColumnN; sortOrderN)

  • range - the range which is to be sorted - Value type: range

  • sortColumn1-N - the column which is used to sort range - Value type: a column range

  • sortOrder1-N - the sort order - Value type: constant

    • up - range is sorted ascending

    • down - range is sorted descending

Example

In this example, the SORT function returns the content of table1, sorted upwards by the values in its second column: