How to Sort by Another Column with SORTBY in Excel

Sort a list by a column you don’t return, by two keys, or by a calculated value like revenue — all with SORTBY.

You will learn to

  • Sort a list by a column that is not in the output
  • Sort by two keys in different directions
  • Sort by a calculation that isn’t in the sheet

How it works

SORTBY(array, by_array1, [sort_order1], …) sorts array using the values in by_array1, which does not have to be part of the result. =SORTBY(A2:A10,C2:C10,-1) lists product names ordered by units sold, highest first, without showing the units.

Add more pairs for tie-breakers, such as rating descending then price ascending. The by_array can also be a calculation: =SORTBY(A2:A10,B2:B10*C2:C10,-1) ranks products by revenue that is never stored in the sheet. SORT, by contrast, can only sort by a column inside the array.

=SORTBY(A2:A10,C2:C10,-1)