SORT Function
Return the values of an array or range sorted. sort_index is the row or column to sort by (1 when omitted), sort_order is 1 for ascending (the default) or -1 for descending, and by_col TRUE sorts the columns instead of the rows. The sorted array spills into the neighboring cells. A sort_index outside the array or another sort_order returns #VALUE!.
Syntax
SORT(array, sort_index, sort_order, by_col)
Category: Lookup. Minimum arguments: 1. Maximum arguments: 4.
Available for supported offline calculation.
Examples
=SORT({3;1;2})
The formula spills 1, 2 and 3 into three rows.
Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.