Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=SORTBY(A2:B6,B2:B6,-1)Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Need it for your exact data?
Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.
Yes. =SORT(A2:C6,2,-1,3,1) sorts by column 2 descending then column 3 ascending. SORTBY achieves the same with array arguments and is often more readable.
Yes. The sort_by array must have the same number of rows (or columns for horizontal sorts) as the array argument, or SORTBY returns a #VALUE! error.
Yes. Both SORT and SORTBY are live formulas — they recalculate whenever the source range changes, so you always see the current sorted view.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: