Excel & Google Sheets Function
SORT function in Excel (with interactive examples)
SORT dynamically sorts a table or range by one or more columns without modifying the original source data.
Syntax
=SORT(array, [sort_index], [sort_order], [by_col])Live Interactive Exercise — Try it nowNo login required
Interactive practice grid (SORT reference)
Try our live spreadsheet engine: total Q1 sales in cell B5 using =SUM(B2:B4).
B5fx
| A | B | |
|---|---|---|
| 1 | Month | Sales |
| 2 | Jan | $1,100.00 |
| 3 | Feb | $1,350.00 |
| 4 | Mar | $1,550.00 |
| 5 | Total | type here |
Insert:
Arguments explained
| array | Required | Range to sort. |
| sort_index | Optional | Column number to sort by (default 1). |
| sort_order | Optional | 1 = ascending (default), -1 = descending. |
Common errors & fixes
#SPILL!: Clear any cells blocking the dynamic output range below or right of the formula.
Excel vs Google Sheets
Google Sheets uses TRUE/FALSE for is_ascending instead of 1/-1.
Practise SORT in a full 4-minute lesson
Every lesson is free to study — build real speed with instant feedback.
Free 1-Page Excel, Google Sheets & SQL Interview Cheat Sheet
The 25 formulas, keyboard shortcuts, and SQL patterns tested most in analyst interviews — emailed instantly, zero spam.