SORT function

SORT is a new Excel function that generates a dynamic array of sorted values based on specified criteria. It allows us to specify the range of values to be sorted, to select columns, sorting order as well as how the data is being recorded, i.e. whether the sorting is done according to the data contained in the rows or according to those contained in the columns.

The syntax of the SORT function is:

SORT (<range>,[<index>],[<order>], [<by columns>])

Only the first argument is required, and it indicates the range of cells we sort. If there is no additional argument sorting is performed by the first column. The index indicates the row number of the column by which we sort the values, and the order is the number that we sort by: +1 (ascending) or -1 (descending). The last parameter is used if the data is recorded by columns, in which case we enter the value TRUE.

Eg. to sort the range by first column in ascending order it is necessary to write the formula: