FormulaCamp
Completed
← All functions
Dynamic arrays

SORTBY

Sorts by other columns.

Syntax

SORTBY(array, by_array1, [sort_order1], …)

Example: =SORTBY(A2:A100,C2:C100,-1)

Available in: Excel 2021+, Microsoft 365

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =SORTBY(B2:B7,C2:C7,-1)

Example spreadsheet for SORTBY
ABCDEF
1RegionProductUnitsPriceResult
2EastPen1202.5Pen
3WestPen802.5Pen
4EastBook4512Book
5NorthBook6012Book
6WestLamp3025Lamp
7EastLamp1525Lamp
Result in F2: Pen

More in Dynamic arrays