# SORT function in Google Sheets

> SORT returns a range sorted by one or more columns and leaves the original data where it is.

Source: https://spreadsheetpractice.com/google-sheets/functions/sort · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** SORT returns a range sorted by one or more columns and leaves the original data where it is.
- **Syntax:** `=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])`
- **Most common use:** `=SORT(A2:C7,3,FALSE)` returns Kim (Column 3 (Sales), largest first)
- **Works in:** Google Sheets, with different arguments from Excel
- **Returns:** An array: the rows of range in the new order.

## What it does

SORT returns a range sorted by one or more columns and leaves the original data where it is. In Google Sheets you give the column number and TRUE for ascending or FALSE for descending, then add more column and order pairs as tie-breakers.

## Syntax

`=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])`

| Argument | Required? | What it is |
|---|---|---|
| `range` | Required | The data to sort, usually without the header row. |
| `sort_column` | Required | The column to sort by: a number counted from the left edge of range, or a separate one-column range the same height. |
| `is_ascending` | Required | TRUE for A to Z and smallest first, FALSE for Z to A and largest first. |

## Examples

Each result was calculated by running the formula on the sample sheet in Google Sheets mode.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| E2 | `=SORT(A2:C7,3,FALSE)` | Kim (spills 6 × 3) | Column 3 (Sales), largest first |
| I2 | `=SORT(A2:C7,2,TRUE,3,FALSE)` | Sam (spills 6 × 3) | Region A to Z, then the biggest sales first within each region |
| M2 | `=SORT(A2:A7)` | Ana (spills 6 × 1) | Just a range: sorts by its first column, A to Z |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E | F | G | H | I | J | K | L | M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Rep | Region | Sales |  | By sales |  |  |  | By region, then sales |  |  |  | Names A to Z |
| 2 | Ana | East | $4,200 |  | Kim | North | $6,230 |  | Sam | East | $5,780 |  | Ana |
| 3 | Raj | West | $5,150 |  | Sam | East | $5,780 |  | Ana | East | $4,200 |  | Kim |
| 4 | Lee | East | $3,900 |  | Raj | West | $5,150 |  | Lee | East | $3,900 |  | Lee |
| 5 | Kim | North | $6,230 |  | Mo | West | $4,510 |  | Kim | North | $6,230 |  | Mo |
| 6 | Mo | West | $4,510 |  | Ana | East | $4,200 |  | Raj | West | $5,150 |  | Raj |
| 7 | Sam | East | $5,780 |  | Lee | East | $3,900 |  | Mo | West | $4,510 |  | Sam |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| Largest values end up last | is_ascending is TRUE or FALSE in Sheets. Use FALSE for largest first; a -1 copied from an Excel formula doesn't sort descending here. |
| The header row lands in the middle of the list | Start range below the header: SORT(A2:C7,3,FALSE), not A1:C7. Keep the header in the row above the formula. |
| It sorts by the wrong column | sort_column counts from the first column of range, not from column A. In SORT(C2:E7,2,FALSE), 2 means column D. |
| #REF! with "Array result was not expanded" | The cells the sorted rows need aren't empty. Clear them, including any old values pasted below the formula. |

## Tips

- Sort filtered results in one step: =SORT(FILTER(A2:C7,B2:B7="East"),3,FALSE).
- Sort by a column you don't show by passing a range as sort_column: =SORT(A2:A7,C2:C7,FALSE) lists names from best sales to worst.

## SORT in Excel

Excel's SORT takes 1 for ascending and -1 for descending instead of TRUE and FALSE, and adds a by_col argument. To sort by several columns, Excel users usually reach for SORTBY.

See [the Excel SORT function](https://spreadsheetpractice.com/functions/sort).

## Questions

### How do I sort by two columns in Google Sheets?

Add another column and order pair: =SORT(A2:C7,2,TRUE,3,FALSE) sorts by region A to Z, then by sales from largest within each region.

### Does SORT change my original data?

No. It writes a sorted copy where the formula is. To reorder the data itself, use Data > Sort range instead.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
