SORT Function
The SORT function is one of the lookup and reference functions. It is used to sort a range of data or an array and to return the sorted array.
Syntax
SORT(array, [sort_index], [sort_order], [by_col])
The SORT function has the following arguments:
Argument | Description |
---|---|
array | The range of data to sort. |
sort_index | An optional argument. A number identifying the column or the row to sort by. |
sort_order | An optional argument. A number determining the sorting order:
|
by_col | An optional argument. A value indicating the sorting direction:
|
Notes
Please note that this is an array formula. To learn more, please read the Insert array formulas article.
How to apply the SORT function.
Examples
The figure below displays the result returned by the SORT function.