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

SORTBY Function

The SORTBY function is one of the lookup and reference functions. It is used to sort a range of data or an array based on the values in a corresponding range or array.


SORTBY(array, by_array, [sort_order], ...)

The SORTBY function has the following arguments:

Argument Description
array A range of data to sort.
by_array An array or range used for sorting.
sort_order An optional argument. A number determining the sorting order. The possible values are listed in the table below.

The sort_order argument can be one of the following:

Numeric value Meaning
1 or omitted Ascending order (by default)
-1 Descending order


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

How to apply the SORTBY function.


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

SORTBY 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