SORT
Sorts the contents of a range or array.
- Excel: Verified match
- Google Sheets: Verified match
- Returns: Array
Examples
=SORT(A1:A5) | A | |
|---|---|
| 1 | 10 |
| 2 | 20 |
| 3 | 30 |
| 4 | 40 |
| 5 | 50 |
Result 10
Syntax
SORT(array, [sort_index], [sort_order], [by_col]) array- range required
sort_index- number optional defaults to
1 sort_order- number optional defaults to
1 by_col- boolean optional defaults to
0
Errors
#ERROR!=SORT()#VALUE!=SORT(A1:A2,1,2)
Related
ARRAY_CONSTRAINTruncates a range to at most the given rows and columns. ARRAYFORMULAEvaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility). ARRAYTOTEXTConverts array to text representation. BYCOLApplies lambda to each column of array. BYROWApplies lambda to each row of array. CHOOSECOLSReturns the specified columns from an array.