How to Sort Data in Google Sheets
Google Sheets offers three sort approaches: Sort sheet (whole sheet), Sort range (selection only), and the SORT function (live formula-based). Plus filter arrows for quick single-column sorting.
⚡ Quick Answer
Click any cell in your data, then Data → Sort sheet → Sort sheet by column [X] (A → Z). For a subset, select the range first and use Sort range.
Method 1: Sort sheet (whole sheet)
Click any cell in the sort column
Just one cell — Sheets sorts the whole sheet based on it.
Data → Sort sheet
Menu shows: Sort sheet by column [X] (A → Z) or (Z → A).
Choose direction
Ascending (A→Z, small→large) or descending. Sort applies to the entire sheet.
Sort sheet moves row 1 into the sort. If row 1 has headers, they get mixed with data. To preserve headers, use Sort range with the "Data has header row" option checked instead.
Method 2: Sort range (selection only)
Better for datasets with headers or when you want to sort just part of the sheet.
Select the range
Highlight the data including headers.
Data → Sort range → Advanced range sorting options
Opens a dialog with more control.
Tick "Data has header row"
Prevents row 1 from getting sorted with the data.
Choose sort column and direction
Pick from the dropdown, choose A→Z or Z→A.
Add more sort keys (optional)
Click Add another sort column. Sheets uses this to break ties in the primary sort.
Click Sort
Data reorders. Headers stay in row 1.
Method 3: Filter arrows (quick single-column)
Create a filter
Data → Create a filter. Filter arrows appear on each column header.
Click a filter arrow
Menu shows sort options at the top: Sort A → Z, Sort Z → A.
Choose direction
Sorts the data by that column, headers stay in place.
Method 4: SORT function (live)
Creates a sorted copy in a new location that updates automatically.
=SORT(A2:C100, 2, TRUE)
=SORT(A2:C100, 2, TRUE, 3, FALSE)
Sorts A2:C100 by column 2 ascending (first line). Multi-key: sorts by column 2 ascending, then column 3 descending (second line). The 2 is the relative column index within the range.
SORT with dynamic filtering
=SORT(FILTER(A2:C100, B2:B100="Approved"), 3, FALSE)
Filter to approved rows, then sort by column 3 descending. Very common pattern for live dashboards.
Sort by custom order
Sheets doesn't have Excel's Custom Lists feature natively, but you can achieve the same result with a helper column:
Helper column: =MATCH(A2, {"Small","Medium","Large"}, 0)
Then sort by the helper column.
Common sorting gotchas
- Numbers stored as text. "10" sorts before "2" because "1" < "2". Convert with
=VALUE(A1)or reformat the column as Number. - Text-formatted dates. Look like dates but sort alphabetically. Reformat as Date.
- Merged cells break sorting. Sheets refuses to sort ranges containing merged cells.
- Blank rows cause partial sorts. Sort sheet stops at the first blank row. Fill blanks or use Sort range.
- Formulas with fixed row references. After sorting,
=A1still points to whatever's now in A1 (not what was there before). Use structured references or lock ranges if you don't want this.
Sheets Wizard — sort by importance, not just column values
Sometimes you need "sort by priority" where priority isn't a column. Sheets Wizard's AI can rank rows by importance, urgency, similarity to a query, or any criterion you describe. Ask "sort these support tickets by likely severity" — Wizard reads the text and orders accordingly.
Install Sheets Wizard →Frequently asked questions
How do I sort in Google Sheets?
Click any cell in the data. Click Data → Sort sheet → Sort sheet by column [X] (A to Z) or (Z to A). Sheets sorts the entire sheet by that column, keeping rows together. To sort just a specific range instead of the whole sheet, select the range first and choose Sort range.
How do I sort by multiple columns in Google Sheets?
Select the data range. Click Data → Sort range → Advanced range sorting options. Tick 'Data has header row'. Choose the primary sort column and order. Click 'Add another sort column' for secondary sorts. Excel handles ties in the primary sort using the secondary column.
How does SORT function work in Google Sheets?
SORT returns a spilled sorted array without modifying source data. Syntax: =SORT(range, sort_column, is_ascending). Example: =SORT(A2:C100, 2, TRUE) sorts A2:C100 by column 2 (relative index within the range) in ascending order. Multiple sort keys: =SORT(A2:C100, 2, TRUE, 3, FALSE).
Why isn't Google Sheets sorting my data correctly?
Common causes: (1) Numbers stored as text ('10' sorts before '2' alphabetically). Convert with =VALUE(A1) or format the column as Number. (2) Dates that are text look like dates but sort alphabetically. (3) Blank rows in the middle stop the sort mid-way. (4) Merged cells prevent sorting entirely. (5) You forgot to tick 'Data has header row', so row 1 sorted into the middle.