SORTBY function
Summary
Sorts the contents of a range or array based on the values in a corresponding range or array
Syntax
SORTBY(array, by_array1, [sort_order1], [by_array2, sort_order2],…)
Example
=SEQUENCE(10)