Powered By GitBook
SORT
Sort a list of texts or numbers

Description

Returns an array containing all the values in the given list of texts or numbers, sorted in order. The function ignores letter case.

Function signature

1
SORT(list: Array<number>|Array<string>, order: String = asc) => Array
Copied!
Parameter
Description
List
List to sort
Order
Order to sort in ("asc" for ascending, "desc" for descending)

Examples

1
array = [10,1,2,6,-1,10,12]
2
textArray = ["ABCD","CC","bb","AA","a","aa","abcd"]
Copied!
Formula
Return value
SORT(array)
[-1,1,2,6,10,10,12]
SORT(array, "desc")
[12,10,10,6,2,1,-1]
SORT(textArray)
["a","AA","aa","ABCD","abcd","bb","CC"]
Last modified 11mo ago
Export as PDF
Copy link