Possible variations include:
A vertical list
A horizontal list
A sequence beginning with a specified number
A sequence using a specified increment
A rectangular array with several rows and columns
A vertical list
A horizontal list
A sequence beginning with a specified number
A sequence using a specified increment
A rectangular array with several rows and columns
1 means ascending.
-1 means descending.
The sort index is the position of the column within the supplied array.
The original data remains unchanged; the formula creates a separate spilled result.
SORT
The sorting column is identified by its numerical position within the array:
=SORT(A2:G100,7,-1)
This means “sort the supplied array by its seventh column.”
SORTBY
The sorting range is supplied directly:
=SORTBY(A2:G100,G2:G100,-1)
This is more flexible because the sort field:
Does not have to be returned in the result.
Can be outside the displayed array.
Can be one of several sort levels.
Unlike RANDBETWEEN, one RANDARRAY formula can generate an entire spilled block.