Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Sort a Google Sheets Table by Multiple Columns

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To sort a Google Sheets table by multiple columns, use the range's filter menu: select your data, click the filter icon, then open the column's filter and choose Sort A to Z or Z to A, and finally add another sort rule in the Advanced range sorting options dialog. This lets you order rows by a primary column and then break ties with a secondary column, so grouped records stay together and the table reads logically. You do not need any add-ons or scripts; the feature is built into the free web and mobile versions of Sheets.

What You'll Need

  • A Google account and access to Google Sheets (web browser or the official mobile app).
  • A table with a header row (recommended) and data you want to reorder.
  • No special permissions beyond edit access to the file.

Step-by-Step

  1. Open your spreadsheet in Google Sheets on the web (sheets.google.com) or in the mobile app. The steps below use the web interface; mobile menus are similar but arranged differently.
  2. Select the entire table including the header row. Click the top-left cell of your data and drag to the bottom-right, or click the column letter headers to select full columns. If you select only one column, Sheets may sort just that column and misalign the rest of the row.
  3. Turn on the filter by clicking the filter icon in the toolbar (it looks like a funnel) or choosing Data > Create a filter. Small dropdown arrows appear in each header cell.
  4. Click the filter arrow in the column you want as your primary sort key (for example, “Department”). A menu opens.
  5. Choose “Sort A to Z” for ascending order or “Sort Z to A” for descending. This applies the first level of sorting.
  6. Add a second sort level. Click the filter arrow in the next column you want to sort by (for example, “Last Name”). In the menu, choose “Sort A to Z” or “Sort Z to A” again. Sheets will keep the first sort and then sort within each group by the second column. If you need more than two levels, use the advanced option below.
  7. For three or more columns, open the advanced sort dialog: click any filter arrow, then choose “Sort range” > “Advanced range sorting options”. In the dialog, tick “Data has header row” so column names appear in the dropdowns. Add rules with the “Add another sort column” button, choose each column and its order (A→Z or Z→A), then click Sort.
  8. Verify the result. Check that rows moved together (no data shifted out of alignment) and that your header row stayed at the top. If something looks wrong, press Ctrl+Z (Cmd+Z on Mac) to undo immediately.
  9. Remove the filter when done (optional): click the filter icon again or choose Data > Remove filter. The sorted order remains.

Note: Menu labels can differ slightly by version, device, or region. On mobile, tap the column header letter, then the three-dot menu, and look for sort options; the advanced multi-column dialog may not be available in all mobile versions, so use the web version for complex sorts.

Common Mistakes

  • Sorting only one column without selecting the whole table. This rearranges that column alone and breaks row relationships. Always select the full range first.
  • Forgetting the header row. If you do not tick “Data has header row” in the advanced dialog, Sheets may sort your headers into the data as if they were values.
  • Using the wrong order. “A to Z” is ascending; “Z to A” is descending. For numbers, ascending means smallest first. Double-check before applying.
  • Sorting a filtered view. If rows are hidden by a filter, sorting may only affect visible rows. Clear filters first if you want to sort the entire table.
  • Assuming multi-column sort is available everywhere. The simple filter menu applies one column at a time; for more than two levels you must use the advanced range sorting options dialog.

Tips

  • Use a primary sort on a category column (like Department) and a secondary sort on a date or name column to keep related rows together.
  • If you sort often, consider converting your range to a table (Format > Convert to table) for built-in filter and sort controls.
  • Before sorting, make a copy of the sheet (File > Make a copy) if the data is critical; sorting changes the order permanently unless you undo.
  • For custom orders (like High, Medium, Low), create a helper column with numbers and sort by that instead.
  • On mobile, you can sort by one column at a time via the column header menu; for multiple columns, switch to the web version.

Troubleshooting

  • Data looks scrambled after sorting: You likely sorted a single column instead of the whole table. Press Ctrl+Z (Cmd+Z) to undo, then reselect the full range and sort again.
  • Header row moved into the data: Undo, then in the advanced sort dialog tick “Data has header row” before sorting.
  • Sort option is greyed out: The sheet may be protected or you may not have edit permission. Check with the file owner.
  • Sorting does not change order: The range may contain formulas that recalculate, or the filter may be hiding rows. Clear filters and try again.
  • Advanced sort dialog missing: On mobile, the full dialog may not be available. Use a desktop browser for multi-column sorting.

Frequently Asked Questions

Can I sort by more than two columns in Google Sheets?

Yes. Use the advanced range sorting options dialog (via any filter arrow > Sort range > Advanced range sorting options) to add as many sort levels as you need.

Does sorting in Google Sheets affect formulas?

Sorting rearranges rows but keeps formulas with their rows. Relative references adjust automatically; absolute references stay fixed. Always verify results after sorting.

Can I sort a table on the Google Sheets mobile app by multiple columns?

The mobile app supports sorting by one column at a time through the column header menu. For multi-column sorts, use the web version in a browser.

What happens if I sort a filtered range?

Sorting applies to the entire selected range, but hidden rows may be affected depending on the filter. To avoid surprises, clear filters before sorting.

Is there a way to sort without changing the original order?

No, sorting changes the row order. To preserve the original, make a copy of the sheet before sorting or use a formula like SORT in a new range.

Can I sort by a custom list, like High/Medium/Low?

Google Sheets does not offer a built-in custom sort order. Create a helper column with numbers (1 for High, 2 for Medium, etc.) and sort by that column.