To sort rows by a column value in Google Sheets, select the entire range or click any cell inside your data, then choose Data > Sort range. Pick the column you want to sort by, choose A to Z or Z to A, and click Sort. This rearranges whole rows so each record stays intact. You can also use the quick sort buttons in the toolbar, but they only sort the column you have selected and can misalign data if you are not careful. The steps below cover both methods, plus how to sort by multiple columns, how to keep headers out of the sort, and what to do when things go wrong.
What You'll Need
- A Google account with access to Google Sheets (desktop browser or the mobile app).
- A spreadsheet with data arranged in columns, ideally with a header row.
- Basic familiarity with selecting cells and ranges.
Step-by-Step
- Open your spreadsheet in Google Sheets on a computer for the most control. The mobile app works too, but the sort menu is more limited.
- Select the data range you want to sort. Click the first cell of your data (for example, A1 if you have headers, or A2 if you want to exclude them) and drag to the last cell, or press Ctrl+A (Windows/ChromeOS) or Cmd+A (Mac) to select all data. If you click a single cell inside a contiguous block, Sheets will usually expand the selection automatically when you sort, but selecting the full range is safer.
- Open the sort menu. Go to Data > Sort range. A dialog box appears. (Menu labels can differ slightly by version, device, or region.)
- Tell Sheets your range has headers. In the sort dialog, tick the box labeled "Data has header row" if your first row contains column names. This keeps the header at the top and lets you sort by column name instead of column letter.
- Choose the column to sort by. Use the "Sort by" dropdown. If you ticked the header option, you will see your column names; otherwise you will see column letters like A, B, C.
- Pick the order. Select A → Z for ascending (smallest to largest, A to Z) or Z → A for descending. For dates, A → Z sorts oldest first; for numbers, smallest first.
- Add a second sort column if needed. Click "Add another sort column" to break ties. For example, sort by Department, then by Last Name. Each additional column is applied in order.
- Click Sort. Your rows rearrange. Check that related data in other columns moved with the sorted column. If it did not, you likely sorted only one column (see Common Mistakes).
- For a quick single-column sort (desktop only): click any cell in the column you want to sort, then use the toolbar buttons with an A over Z (ascending) or Z over A (descending). Sheets will ask whether to extend the selection to the rest of the data; choose "Extend range" to keep rows together. This is faster but less flexible than the Sort range dialog.
- On mobile: open the Sheets app, tap a cell in the column, tap the three-dot menu, choose "Sort range" (or "Create a filter" then use the filter menu), pick the column and order, and confirm. The exact wording varies by app version.
Common Mistakes
- Sorting only one column. If you select just column B and sort, only B moves, and the rest of each row stays put, scrambling your records. Always select the full data range or use the Sort range dialog with the header option.
- Forgetting the header row. If you do not tick "Data has header row," your header will be sorted into the data as if it were a value, usually ending up somewhere in the middle.
- Including blank rows or totals. Blank rows can sort to the top or bottom, and total rows can get mixed in. Exclude them from the range or remove them before sorting.
- Assuming formatting moves with data. Cell formatting (colors, bold) usually moves with the cells, but conditional formatting rules tied to specific cells may not follow the data. Check after sorting.
- Sorting a filtered view. If a filter is active, sorting may only affect visible rows or behave unexpectedly. Clear filters first (Data > Turn off filter) if you want to sort everything.
Tips
- Use Data > Create a filter for temporary sorting and filtering without changing the underlying order permanently. You can remove the filter later to restore the original order (if you have not saved over it).
- To preserve the original order, work on a copy (File > Make a copy) or add a helper column with row numbers before sorting, then sort by that column to restore.
- When sorting by dates or times, make sure the cells are formatted as dates/numbers, not text. Text dates sort alphabetically (e.g., "April" before "January").
- For multi-level sorts, the order of columns in the dialog matters: the first column is the primary sort, the second breaks ties, and so on.
- Use named ranges (Data > Named ranges) if you sort the same table often; then you can select the range quickly.
Troubleshooting
- Data got scrambled after sorting. Undo immediately with Ctrl+Z (Windows/ChromeOS) or Cmd+Z (Mac). Then re-select the full range and sort again using the Sort range dialog with the header option ticked.
- Sort option is grayed out. You may have a protected range, a filter view active, or the sheet is in a state where sorting is disabled. Check Data > Protected sheets and ranges, and turn off any filter view.
- Header row moved into the data. Undo, then re-sort with "Data has header row" ticked. If the header still moves, ensure the header row is actually the first row of your selected range and contains text, not numbers.
- Sorting does not produce the expected order. Check for leading spaces, mixed data types (numbers stored as text), or hidden characters. Use TRIM or clean the data. Also confirm whether you chose ascending or descending.
- Mobile app sort behaves differently. The mobile app may not offer multi-column sort or the header option in the same place. For complex sorts, use a desktop browser.
- Formulas break after sorting. Relative references can shift when rows move. If you have formulas that refer to specific cells, consider using absolute references ($A$1) or structured references, and test on a copy first.
Frequently Asked Questions
Can I sort by a column without moving the rest of the row?
No—sorting a single column in Google Sheets will rearrange only that column and misalign your data. Always sort the entire row range to keep records together.
How do I sort by multiple columns?
Use Data > Sort range, tick "Data has header row," then click "Add another sort column" and set the order for each column. The first column is the primary sort.
Does sorting in Google Sheets affect other users?
Yes, sorting changes the spreadsheet for everyone with edit access. If you only want a temporary view, use a filter instead.
Can I undo a sort?
Yes, press Ctrl+Z (Windows/ChromeOS) or Cmd+Z (Mac) immediately after sorting. Undo history is limited, so act quickly.
Why does my date column sort alphabetically?
The cells are probably formatted as plain text. Select the column, go to Format > Number > Date, and re-enter the dates if needed.
Is sorting available in the Google Sheets mobile app?
Yes, but with fewer options. Tap a cell, open the three-dot menu, and look for Sort range. For multi-column sorts, use a desktop browser.