Excel SORTBY function⚡ Sort by another column
The SORTBY function: Sort by another column. Names ordered by sales. This page shows the syntax, a worked example with its result and how the formula reads.
What does SORTBY do?
Sort by another column. Names ordered by sales
SORTBY syntax
=SORTBY(array, by_array1, [sort_order1], [by_array2, sort_order2], ...)
Arguments in square brackets [ ] are optional · argument names follow Microsoft's documentation
SORTBY example with the result
=********
👑 Ready-to-use example formula for VIP supporters only · Become VIP
Formula in cell D2 Yellow cells = result
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Score | Ranking | |
| 2 | Ton | 72 | Fon | |
| 3 | Fon | 95 | Mod | |
| 4 | Bee | 60 | Ton | |
| 5 | Mod | 88 | Bee |
How it reads: Sorts the names by score, high to low, without showing the scores
Frequently asked questions about SORTBY
What does SORTBY do?
Sort by another column. Names ordered by sales
What does the SORTBY example return?
The example formula in cell D2 spills its results into several cells starting at D2, as shown in the example table.
Which Excel versions have SORTBY?
Excel for Microsoft 365 and Excel 2021 or later, according to Microsoft's function list. Older versions show #NAME?.
🕸️ More dynamic arrays formulas and related ones
Source: support.microsoft.com
Checked 17 November 2026 · by Black Sheep Barn · example results are calculated by the app's example engine, for learning