To use advanced sort in Google Sheets, select the full data range, then choose Data > Sort range > Advanced range sorting options. Mark whether the range has a header row, choose the first column to sort by, and select Add another sort column to set tie-breakers—for example, sort sales from highest to lowest, then names from A to Z.
What advanced sorting means in Google Sheets
A basic sort orders a range by one column. An advanced sort applies several ordered rules to the same rows. Google Sheets evaluates the first rule, then uses the second rule only to arrange rows tied under the first, and continues down the list of rules as needed. This is useful when one column alone does not create a clear, practical order.
For example, a sales table might need to show the largest sales totals first. If several people have the same total, sorting by name as a second rule makes the results predictable. The operation moves complete rows within the selected range; it is not just a visual rearrangement of one column. Selecting the right range is therefore as important as choosing the sort rules.
How to sort a range by multiple columns
- Select the full block of related data, including every column that belongs to each record. Avoid selecting only the column you want to sort.
- Open Data > Sort range > Advanced range sorting options.
- If the first row contains labels such as Name or Sales, select Data has header row. This keeps the labels out of the sorted records.
- Under Sort by, choose the primary column and select A to Z or Z to A. For numbers and dates, those choices mean ascending or descending order; for text, they mean alphabetical order.
- Select Add another sort column, choose the next field, and set its direction. Add further rules if needed, then select Sort.
Rules are applied in the order shown in the dialog. Put the most important criterion first. A secondary rule does not override the primary one: it only changes the order among rows that share the same primary value. If all the selected fields tie, Sheets has no additional rule to distinguish those records.
A worked example with a tie-breaker
Suppose a table has Name, Region, Sales, and Date in columns A through D, with records in rows 2 through 6. You want the highest sales first and alphabetical names within each equal-sales group. Select A1:D6, include the header-row setting, sort by Sales from Z to A, and add Name from A to Z.
For example, if Ava and Ben each have sales of 5,100, Ava appears before Ben. If Maya and Noor each have 4,200, Maya appears before Noor. The two name comparisons do not move a 4,200 record ahead of a 5,100 record because Sales remains the primary rule. Adding Region as a third rule would only matter where both Sales and Name match.
This approach works for common workflows such as ordering tasks by priority and then due date, ranking products by revenue and then stock level, or arranging a roster by department and then surname. Think of the rules as a hierarchy: the first field divides the records into groups, and later fields organize each group.
Sort a sheet or just a selected range?
Use a selected range when the data is one table among other content, or when you want to be precise about which columns move together. Include all fields for each record. If you select only one column from a multi-column table and sort it, names, dates, or amounts in neighboring columns may no longer belong to the same record. That is one of the most consequential sorting mistakes.
To reorder a whole sheet by one column, use the sheet sorting options under Data > Sort sheet, then choose the column and direction offered in the menu. This is different from advanced range sorting, which lets you add multiple criteria. Check that the sheet contains the records you intend to move before sorting it; a whole-sheet sort is not a substitute for carefully selecting a table when unrelated content is present.
For a table with a title above its headers, select only the table range rather than including the title row as if it were a record. Also avoid leaving blank rows or columns inside the data block, since they can make it less clear where the table begins and ends. A consistent rectangular range is easiest to sort reliably.
Custom priorities, dates, and blank cells
Google Sheets offers alphabetical, numerical, and date ordering, but an A-to-Z sort does not understand a custom business sequence such as Urgent, Normal, and Low. One practical option is to add a helper column with numeric ranks: assign Urgent 1, Normal 2, and Low 3, then sort by that helper column from A to Z. Include the helper column in the selected range so each rank stays with its record. You can hide the helper column afterward if it is not useful to readers.
Another option is to create a temporary order field for values such as weekdays or workflow stages. The key is to define the sequence explicitly rather than assuming alphabetical order matches the intended priority. For example, alphabetical sorting would not put Monday through Sunday in calendar order.
Dates should be stored as actual date values if you want chronological sorting. Text that merely looks like a date can sort unexpectedly, especially when formats differ. Similarly, numbers stored as text may not sort like numeric values. If an order seems wrong, check the underlying cell type and formatting rather than relying only on how the value appears on screen. Decide how blank cells should be handled by checking the resulting order and, when needed, using a helper field to put missing values where they make sense.
Use the SORT formula for a live sorted view
Menu sorting changes the order of the data in its range. If you want a separate, automatically updated sorted result while leaving the source table in place, Google Sheets also has the SORT function. It returns a sorted version of a range and can accept multiple sort-column and direction pairs.
With Name, Region, Sales, and Date in A2:D6, and the Sales values 5,100 for Ava and Ben, 4,200 for Maya and Noor, and 3,900 for Leo, enter =SORT(A2:D6,3,FALSE,1,TRUE) in an empty area. The third column of the selected range is Sales, so FALSE sorts it descending; the first is Name, so TRUE sorts names ascending within equal sales. The returned order is Ava, Ben, Maya, Noor, then Leo. The source rows are not rearranged.
Place a formula like this where enough empty cells are available for the results to expand. The sort-column numbers count from the left edge of the range, not from the worksheet’s column A. In the example, 3 means the third column of A2:D6. If you add records beyond row 6, they will not be included unless the range is expanded or set up to cover the additional rows. Formula results can also be blocked if cells in the output area are occupied.
Filter views and collaboration
If you need a particular order for viewing or reviewing records without changing the main working arrangement, consider a filter view. In Google Sheets in a web browser, use Data > Filter views > Create new filter view, then use the filter controls in the column headings to sort or filter the view. This can be useful for a shared tracker when one person wants to inspect overdue tasks while others work with the same data.
A filter view is different from sorting the underlying range directly: it provides a saved view with its own filtering and sorting choices. It is especially useful when collaborators need different ways to inspect a common table. Name useful views clearly, and make sure the selected range includes the complete table so records remain intact. If you do want to change the shared row order itself, use a regular range sort and communicate that change to collaborators.
Common problems and how to avoid them
- Only one column moves: Select the full table, not just the column being sorted. Check that each row’s fields stay together.
- The header gets sorted into the records: In advanced range sorting options, enable Data has header row, or exclude the header from the selected range.
- Numbers or dates appear out of order: Check for values stored as text, inconsistent date entries, or mixed data types in the same column.
- A custom sequence sorts incorrectly: Alphabetical order is not a custom priority list. Add a ranked helper field or use a separate sorted view.
- Some records are missing: Confirm the selected range reaches the last row and includes all relevant columns. A blank row may have caused you to select only part of a table.
- A formula result does not update as expected: Check that the formula’s range includes new records and that its output area is clear.
Before sorting an important shared dataset, it is sensible to confirm the range and keep a recoverable version of the original data, such as a copy of the sheet. Sorting is a normal editing action, but a mistaken range can be disruptive, particularly in a collaborative workbook.
How Google Sheets sorting compares with Excel
The core idea is similar in Google Sheets and Microsoft Excel: select related records, specify a primary field, and add secondary sort levels. The instructions here are for Google Sheets in a web browser. Excel has its own Sort dialog and ribbon commands, so its menu paths and labels are not necessarily the same. A workbook’s formulas and features may also differ between the products, so do not assume that a Sheets-specific workflow transfers unchanged to Excel.
Within Sheets, choose a manual sort when you need to reorder the source data itself; choose SORT when you need a separate formula-driven result; and choose a filter view when the goal is a saved way to inspect shared data. Matching the method to the task helps prevent accidental changes to the source table and makes the result easier for other people to understand.
Frequently Asked Questions
Can I sort Google Sheets by two columns?
Yes. Select the range and go to Data > Sort range > Advanced range sorting options. Set the first criterion, select Add another sort column, and set the second one.
How do I keep the header row at the top?
In the advanced range sorting dialog, select Data has header row. Alternatively, select only the data rows and leave the header outside the range.
Can I sort by a custom order such as High, Medium, Low?
Yes, but alphabetical sorting will not automatically treat those labels as a priority sequence. Add a helper column with a numeric rank and sort by that column, or create a separate result that uses an explicitly defined order.
Does sorting change the original data?
A regular range or sheet sort changes the row order in the source. A SORT formula creates a separate sorted result, while a filter view lets you work with a saved view rather than directly choosing a new permanent row order.
Why are my rows sorting incorrectly?
Common causes include sorting only one column, including a header as data, selecting an incomplete range, or having numbers and dates stored as text. Check the range and the underlying values first.
Related
- Excel Time Format Over 24 Hours: Display Elapsed Time Correctly
- Excel Time Format Without Seconds: How to Set It
- Excel Time Format: Show Hours and Minutes Only Correctly
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Cell Bullet Points: Add and Format Lists in CellsYes. In Excel for Microsoft 365 on Windows, edit a cell and press Alt+0149 on the numeric keypad…
- How to Insert a New Row in Excel on Windows and MacTo insert a new row in Excel for Microsoft 365 on Windows, select the row heading where you…
- Compare Two Excel Sheets: Find Differences Step by StepTo compare two Excel sheets, use a cell-by-cell formula when corresponding cells line up, or match records by…
- Excel Page Break Preview: How to View and Adjust PagesExcel Page Break Preview shows how a worksheet will be divided into printed pages. In Excel for Microsoft…
- Excel Table Color Combinations: Choose and CustomizeExcel table color combinations come from built-in table styles or a custom style you create: select a table,…
- How to Delete a Filter View in Google SheetsTo delete a filter view in Google Sheets, open the spreadsheet in a web browser, go to Data…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.