SORT(array,[sort_index],[sort_order],[by_column])
=SORT(range)
The SORT function can be used to sort data in a Sourcetable worksheet. This example will sort the data by the first column in the range in ascending order.
=SORT(range,1,1)
The SORT function can also be used to sort by a specific column and order, where the 1 after the range is the column number that will be used to sort the data, and the 1 after that is the order. This example will sort the data by the first column in ascending order.
=SORT(range,1,-1)
The SORT function can also be used to sort by a specific column and order.This example will sort the data by the first column in descending order.
The SORT function is a useful tool to easily organize data by sorting an array or range according to a specified criterion. It returns an array of the sorted elements. The SORTBY function is a better choice when sorting data in the grid.