If values in the source data change, the output from SORTBY will update automatically.
The SORTBY function takes three primaryarguments:array,by_array, andsort_order.
The first argument,array, is the range or array to be sorted.
The second argument,by_array, contains the values to be used for sorting.
These values can come from an existing range, orfrom an array created by a formula.
However,by_arraymust have dimensions compatible witharray.
For example, ifarraycontains ten rows,by_arrayshould also contain ten rows.
Finally, the optionalsort_orderargument determines sort direction.
Use 1 forascendingorder and -1 fordescendingorder.
By default, SORTBY will sort in ascending order.
To sort by more than one level, provide additionalsort_byandsort_orderarguments in pairs.
Instead, the range or array provided for theby_arrayargument will determine the sort orientation automatically.
Whenby_arrayis a vertical range, SORTBY sorts vertically by rows.
Whenby_arrayis a horizontal range, SORTBY sorts horizontally by columns.
In this case, both contain five rows.
Example:sort by two columns.
The output from FILTER is dynamic.
If source data or criteria change, FILTER will return a new set of results.
Values can be sorted by one or more columns.
SORT returns a dynamic array of results.
The range or array used to sort does not need to appear in results.
RANDARRAY Function
The Excel RANDARRAY function generates an array of random numbers between two values.
The size or the array is specified byrowsandcolumnsarguments.
The generated values can be either decimals or whole numbers.
SEQUENCE Function
The Excel SEQUENCE function generates a list of sequential numbers in an array.
The array can be one dimensional, or two-dimensional, determined byrowsandcolumnsarguments.