Google Sheets: How to Order by Number (Sort Guide)
In this article
To order by number in Google Sheets, select your data range, then go to Data > Sort range > Advanced range sorting options. Tick "Data has header row" if your first row contains labels, choose the column with the numbers from the Sort by drop-down, and pick either A → Z (smallest to largest) or Z → A (largest to smallest). Click Sort. That single pass reorders every row together so the numbers and their related data stay aligned. If you only want to reorder a single column and leave the rest alone, you can use the A → Z or Z → A buttons in the toolbar instead, but be aware that this moves only the selected column and can break the relationship between columns.
What You'll Need
- A Google account and access to Google Sheets (desktop browser or the mobile app).
- A spreadsheet with at least one column of numbers (whole numbers, decimals, currency, or dates stored as numbers).
- Optionally, a header row so you can use the "Data has header row" option and keep labels in place.
Step-by-Step
- Open your spreadsheet. Go to sheets.google.com and open the file, or open the Google Sheets app on your phone or tablet. The steps below are written for the desktop browser; mobile differences are noted where they matter.
- Select the data you want to sort. Click the first cell of your range and drag to the last cell, or press Ctrl+A (Cmd+A on Mac) to select the whole sheet. Include every column that belongs with the numbers — if you sort only the number column, the other columns will not move with it and your rows will no longer match.
- Open the sort menu. With the range selected, click Data in the top menu, then choose Sort range. A submenu appears with options like "Sort range by column A, A → Z" and "Advanced range sorting options." Pick Advanced range sorting options for full control.
- Tell Sheets about your header row. In the dialog that opens, tick the box labelled "Data has header row" if your first row contains column titles. This keeps the header at the top and excludes it from sorting. If your data has no header, leave it unticked.
- Choose the number column. In the "Sort by" drop-down, select the column that contains the numbers you want to order by. The drop-down shows either the header text or the column letter, depending on whether you ticked the header box.
- Pick the order. Select A → Z to sort from smallest to largest, or Z → A to sort from largest to smallest. For plain numbers, A → Z means ascending (1, 2, 3…) and Z → A means descending (3, 2, 1…).
- Add a second sort level if needed. Click Add another sort column to break ties — for example, sort by "Score" descending, then by "Name" ascending so equal scores appear alphabetically. This is optional but useful for clean reports.
- Click Sort. The range reorders immediately. Check that the numbers are in the expected order and that adjacent columns still line up with the correct rows.
- On mobile: select the range, tap the three-dot menu, choose Sort range (or the sort icon), then pick the column and direction. The mobile app may not show every advanced option, but basic ascending/descending sorting works the same way.
Common Mistakes
- Sorting only one column. If you select just the number column and click the toolbar A → Z button, Sheets may ask whether to expand the selection. If you choose "Continue with current selection," only that column moves and your rows become mismatched. Always include all related columns or use Data > Sort range with the full range selected.
- Forgetting the header row. If you tick "Data has header row" when there is no header, the first data row gets treated as a label and stays fixed at the top. If you leave it unticked when there is a header, the header gets sorted into the data.
- Numbers stored as text. Values that look like numbers but are formatted as text (often left-aligned by default) sort alphabetically: 10 comes before 2. Fix by converting to numbers — select the column, then use Format > Number > Number, or re-enter the values without extra spaces or apostrophes.
- Hidden or filtered rows. Sorting a filtered range can produce unexpected results because hidden rows may be included or excluded depending on the selection. Clear filters first, or sort the full dataset before filtering.
- Merged cells. Merged cells break sorting. Unmerge them before you sort (Format > Merge cells > Unmerge).
Tips
- Use Data > Sort range > Advanced range sorting options rather than the toolbar buttons when you have multiple columns — it gives you a clear preview of which column drives the order.
- If you sort often, consider creating a filter view (Data > Filter views) so you can reorder without affecting collaborators' view.
- To sort by a number that is calculated (for example, a SUM or COUNTIF), sort the column containing the formula results — the formulas move with their rows.
- Dates and times are stored as numbers in Sheets, so the same sort steps work for chronological ordering.
- Before sorting a large or important sheet, make a copy (File > Make a copy) so you can revert if something goes wrong.
Troubleshooting
The numbers sort as text (10 before 2). Check alignment: text is left-aligned, numbers are right-aligned by default. Select the column and use Format > Number > Number, or use the VALUE function in a helper column to convert text to numbers, then sort by that helper column.
Rows no longer match after sorting. You likely sorted a single column. Undo with Ctrl+Z (Cmd+Z on Mac) immediately, then reselect the full range including all columns and sort again using Data > Sort range.
The header row moved into the data. Undo, then redo the sort with "Data has header row" ticked. If the header still moves, check that the header row is actually the first row of your selected range and that it contains text, not numbers.
Sort options are greyed out. This can happen if the sheet is protected or you are viewing a filter view you cannot edit. Check with the sheet owner or exit the filter view. It can also happen if the range contains merged cells — unmerge them first.
Sorting does nothing on mobile. Make sure you have selected a range that includes the number column and at least one adjacent column. If the app shows only a single-column sort, use the desktop browser for full advanced sorting options.
Frequently Asked Questions
How do I sort numbers in ascending order in Google Sheets?
Select the full data range, open Data > Sort range > Advanced range sorting options, tick "Data has header row" if applicable, choose your number column under "Sort by," select A → Z, and click Sort. For a quick single-column sort, the toolbar A → Z button works but may only move that column.
Why does Google Sheets sort 10 before 2?
Those values are being treated as text, not numbers. Text sorts character by character, so "10" comes before "2." Convert the column to Number format (Format > Number > Number) or remove leading apostrophes and extra spaces, then sort again.
Can I sort by number without messing up the other columns?
Yes — select all the columns that belong together before sorting. Sheets moves entire rows as a unit when you sort a multi-column range, so related data stays aligned. Avoid sorting a single column in isolation.
How do I sort by two number columns?
In the Advanced range sorting options dialog, set the first "Sort by" column, then click "Add another sort column" and choose the second column and direction. Sheets applies the first sort, then uses the second to break ties.
Does sorting work the same in the Google Sheets mobile app?
Basic ascending and descending sorting is available on mobile, but the advanced multi-level sort dialog is more limited. For complex sorts, use the desktop browser version of Sheets.
Can I undo a sort?
Yes. Press Ctrl+Z (Cmd+Z on Mac) immediately after sorting, or use the Undo arrow in the toolbar. Undo history is per-user and may not cover changes made by others in a shared sheet.