Articles with the tag:
Articles with the tag:
Try in the cloud
Try in the cloud

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.


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:
  • 1 or omitted for ascending order (by default),
  • -1 for descending order.
by_col An optional argument. A value indicating the sorting direction:
  • FALSE or omitted for sorting by rows when your data is organized vertically.
  • TRUE for sorting by columns when your data is organized horizontally.


Please note that this is an array formula. To learn more, please read the Insert array formulas article.

How to apply the SORT function.


The figure below displays the result returned by the SORT function.

SORT Function

Return to previous page
Try now for free Try and make your decision No need to install anything
to see all the features in action