> For the complete documentation index, see [llms.txt](https://docs.nedyx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nedyx.com/nedyx/clearlines-functions/range-functions/sort.md).

# SORT

#### Syntax <a href="#syntax.49" id="syntax.49"></a>

**SORT**(*range;* *sortColumn1;* *sortOrder1;* …; *sortColumnN;* *sortOrderN*)

* *range* - the range which is to be sorted - ***Value type**: range*
* *sortColumn1-N* - the column which is used to sort *range* - ***Value type**: a column range*
* *sortOrder1-N* - the sort order - ***Value type**: constant*
  * <mark style="color:red;">up</mark> - *range* is sorted ascending
  * <mark style="color:red;">down</mark> - *range* is sorted descending

#### Example <a href="#example.4" id="example.4"></a>

In this example, the SORT function returns the content of table1, sorted upwards by the values in its second column:

<figure><img src="/files/nfSEmGagdZWq0Jfbiirn" alt=""><figcaption></figcaption></figure>
