- Home
- SORTBY function
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.
Syntax
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 |
Notes
Please note that this is an array formula. To learn more, please read the Insert array formulas article.
How to apply the SORTBY function.
Examples
The figure below displays the result returned by the SORTBY function.
Host ONLYOFFICE Docs on your own server or use it in the cloud
Article with the tag:
Browse all tags