How do I use SORT in Excel?
Use SORT when you want to sort a range. Enter Target range, Sort index, Sort order in that order, then add optional arguments when needed.
Sorts an array by specified index/order.
SORT(array, [sort_index], [sort_order], [by_col])array
RequiredSpecify a reference range. You can drag or click start/end cells.
sort_index
OptionalEnter a numeric value.
sort_order
OptionalEnter a numeric value.
by_col
OptionalSpecify TRUE or FALSE.
Use SORT to return the result with these settings (Target range: A2:D8 (columns A to D), Sort index: 4, Sort order: -1 (descending), Compare by column: FALSE (by rows, not columns)). You can set ranges by dragging from the start cell to the end cell in the same argument field.
| # | AProduct ID | BCategory | CProduct Name | DSales |
|---|---|---|---|---|
| 2 | P001 | Food | Apple | 1200 |
| 3 | P002 | Food | Banana | 980 |
| 4 | P003 | Stationery | Notebook | 450 |
| 5 | P004 | Stationery | Pen | 300 |
| 6 | P005 | Food | Grapes | 1500 |
| 7 | P006 | Stationery | Ruler | 250 |
| 8 |
How to Use (Formula)
=SORT(A2:D8, 4, -1, FALSE)Result
P005, Food, Grapes, 1500 | P001, Food, Apple, 1200 | P002, Food, Banana, 980 | P003, Stationery, Notebook, 450 | P004, Stationery, Pen, 300 | P006, Stationery, Ruler, 250 | , , ,
Use SORT when you want to sort a range. Enter Target range, Sort index, Sort order in that order, then add optional arguments when needed.
Use the "Start Function Practice" button to jump straight into SORT drills.
The main arguments are Target range, Sort index, Sort order, Compare by column. Start with the required ones, then add optional arguments if needed.