deepcalc
DocsSORTBY

SORTBY

Sorts a range or array by values in a corresponding range.

  • Excel: Verified match
  • Google Sheets: No equivalent
  • Returns: Array

Examples

=SORTBY(A1:A5, B1:B5, -1)
AB
1 102
2 204
3 306
4 408
5 5010
Result 50

Syntax

SORTBY(array, by_array1, [sort_order1], [by_array2…], [sort_order2…])
array
range required
by_array1
range required
sort_order1
number optional defaults to 1
by_array2…
range optional
sort_order2…
number optional

Errors

#ERROR!
=SORTBY(A2:A3,B2:B3,1,C2:C3)