To sort in Google Sheets, select the data you want to organize, open Data, and choose a sort command: use Sort range to reorder a selected table, or Sort sheet to sort the whole sheet by a column. Choose the column and whether to sort A to Z or Z to A; if the table has a header, mark that it has a header row before sorting.
Choose What You Want to Sort
The most important decision is whether to sort a range or an entire sheet. A range is a specific block of cells, such as a customer list in columns A through D. Sorting that range changes the order of its rows but leaves cells outside the selected block where they are. That can be useful for a self-contained table, but it can separate related information if you select only one column from a larger dataset.
Sorting a sheet by a column reorders rows across the sheet according to that column. This is usually the safer choice when each row represents one record and information in several columns belongs together. For example, if a name is in column A, an order date in B, and an amount in C, sorting the sheet by the date keeps each name and amount with its original record.
- Use Sort sheet when the rows form one dataset that spans several columns.
- Use Sort range when you want to reorganize a defined table without affecting other content elsewhere on the sheet.
- Use a filter or filter view when you want to sort or narrow the data while keeping the original dataset easy to inspect.
Before sorting, check for notes, totals, or other content beside or below the table. A sort affects the selected range or sheet, not necessarily every nearby cell you consider part of the same record. Selecting the right scope prevents unrelated cells from being mixed into the results.
Sort a Range Step by Step
For a table with a header row, use the range-sorting dialog so Sheets can distinguish labels such as “Name” or “Date” from the records. In a browser, follow these steps:
- Select the cells in the table, including the header row. Include every column whose values must stay attached to each record.
- Open Data > Sort range > Advanced range sorting options.
- In the dialog, select Data has header row if the first selected row contains column names.
- Choose the column to sort by, then choose A to Z for ascending order or Z to A for descending order.
- Select Sort to apply the change.
For example, select a list containing Name, City, and Signup Date, mark the header-row option, and sort by City A to Z. The cities appear alphabetically, and the names and dates move with their respective rows. If you leave the header option unchecked, the column label may be treated like ordinary data and move into the sorted results.
When a range has no header row, do not mark that option. If the selection contains only a single column, sorting it alone may put values out of step with corresponding information in neighboring columns. Select the complete record range when the data is meant to stay together.
Sort an Entire Sheet by One Column
If the table occupies the sheet and its rows should move together, click a cell in the column you want to use as the key, then choose Data > Sort sheet and select the appropriate ascending or descending option for that column. The available wording identifies the column, for example sorting by column A. This approach is handy for a simple table because it sorts the sheet’s rows rather than just the clicked column.
Check that the header is recognized or otherwise excluded from the records before you sort. If the sheet contains separate tables, titles, or notes, sorting the entire sheet can disturb them. In that situation, select the table and use Sort range instead. If you are uncertain about the scope, make a copy of the sheet first or try the sort on a small duplicate of the data.
Sort by More Than One Column
A single sort key may not be enough when values repeat. For example, sorting a class list by Grade groups students by grade, but it does not determine the order of students within each grade. The advanced range-sorting dialog lets you add another sort column. Set the main key first, then select Add another sort column and choose a second key and direction.
Suppose a roster has Department, Last Name, and First Name columns. Sort first by Department A to Z, then add Last Name A to Z, and then First Name A to Z if needed. Sheets applies the first key as the primary grouping and uses the later keys to order rows within ties. The order of the sort keys matters: putting Last Name first would group everyone by surname instead of by department.
Multiple keys also help with dates and amounts. You might sort invoices by due date ascending, then by customer name ascending to make invoices with the same date easier to scan. Choose directions deliberately: a descending secondary key can be useful, but it will produce a different within-group order than an ascending one.
Sort with a Filter or Filter View
A filter adds dropdown controls to the header row. Select the data, including its headers, and choose Data > Create a filter. Use a column’s filter control to sort A to Z or Z to A, or select specific values to display. A filter can hide rows that do not match the chosen conditions; it does not delete those records.
Filter views are useful when different people need different ways to examine the same shared data. Choose Data > Filter views > Create new filter view, then sort or filter within that view. A named view can be reopened later, and it avoids imposing an individual’s filtered display on everyone using the sheet in the same way that a regular filter may affect the shared view. Menu wording or availability can vary with the sheet’s current state and permissions.
Use a regular filter for a straightforward shared filter on a table. Choose a filter view when you want a separate view for a particular task, such as inspecting overdue orders, without repeatedly changing the sheet’s main display. In either case, sorting a filtered list changes the row order; hiding rows through criteria is different from sorting them.
Use a Formula for a Separate Sorted View
Google Sheets also has a SORT function. Unlike a menu sort, it returns a sorted result in a different area instead of rearranging the source cells. This is useful when you want to retain the original order and show a live sorted copy. Leave enough empty space for the result to expand, and avoid placing it where it could overwrite existing cells.
With names in A2:A6 and corresponding scores in B2:B6, enter =SORT(A2:B6,2,FALSE) in an empty cell. It returns both columns ordered by the second column, the score, from largest to smallest; names remain paired with their scores. In Sheets, the second argument identifies the sort column within the supplied range, and FALSE means descending order.
With names in A2:A6, departments in B2:B6, and scores in C2:C6, enter =SORT(A2:C6,2,TRUE,3,FALSE) in an empty cell. The result sorts department A to Z first and score from largest to smallest within each department. Formula-based sorting is dynamic: when source values change, the displayed result can update. It does not change the source row order, and the output area must remain clear for the returned array.
Prepare Data for Reliable Sorting
Sorting works best when each column contains one kind of information and each row is a complete record. Use one header row, avoid blank rows within the table, and do not merge cells inside the data. A blank line can make it harder to select the intended range, while merged cells can prevent Sheets from sorting a range cleanly.
Check whether values that look alike are stored alike. Dates stored as actual dates sort chronologically; dates typed as text may sort alphabetically or inconsistently. Likewise, numbers stored as text can appear in an unexpected order, such as 1, 10, 2, rather than 1, 2, 10. If the result looks wrong, inspect the cell format and the underlying values rather than repeatedly sorting in the opposite direction.
Locale and formatting can affect how text and dates are interpreted. If a date such as 03/04/2026 is ambiguous, make sure the spreadsheet’s locale matches the format you intend. You can check it under File > Settings. For alphabetical sorts, capitalization and punctuation may also make the order look different from what you expected; verify a few results at the top and bottom of the sorted list.
Common Sorting Problems and Fixes
- Only one column moved. Undo immediately if other fields no longer match. Select the complete table and sort the range again, or sort the sheet when the whole dataset belongs together.
- The header moved into the data. Reopen the range sort and enable Data has header row, or adjust the selected range so it excludes the header.
- Numbers or dates appear out of order. Check for values stored as text, inconsistent date formats, or mixed content in the column. Correct the source values, then sort again.
- Some records seem missing. Check whether a filter is hiding rows. Clear the filter criteria or turn off the filter to see the complete dataset.
- The sort option is unavailable or the sort fails. Look for merged cells, protected ranges, or a selection that includes incompatible cells. Adjust the selection or permissions as appropriate.
Sorting is a change to the sheet’s row order, not a way to permanently remove unwanted entries. If you need to exclude records, filter them or make a separate copy before deleting anything. Before a consequential reordering, consider duplicating the tab through its sheet menu so you have a reference copy.
Undoing a Sort and Working with Others
Immediately after a sort, use Edit > Undo or the keyboard shortcut Ctrl+Z on Windows and ChromeOS. On a Mac, use Command+Z. Undo is most dependable when used straight away; after many later edits, it may take several undo actions to return to the earlier state. Google Sheets version history can also help recover an earlier version, though restoring one affects the sheet’s contents and should be done carefully.
In a shared spreadsheet, tell collaborators before changing a shared sort or filter when the display matters to their work. A normal sort changes the row order for everyone who sees that sheet. Filter views offer a separate way to inspect the same data, but they do not create a separate copy of the underlying records. For important data, use named tabs, clear headers, and a duplicate before making a major reorganization.
Google Sheets is browser-based, so the menu paths above refer to the web interface. Excel has similar sorting ideas, but its commands and dialogs differ; do not assume an Excel ribbon path or shortcut will match Sheets. On phones and tablets, controls may be arranged differently, so use the Google Sheets app’s menus and verify the selected range carefully before applying a sort.
Frequently Asked Questions
How do I sort alphabetically in Google Sheets?
Select the table or click a cell in the relevant column, then use Data > Sort range or Data > Sort sheet. Choose the appropriate column and select A to Z. Include all related columns so each row remains intact.
How do I sort by date from oldest to newest?
Sort the date column A to Z, with the complete table selected or the sheet sort option chosen. Ensure the entries are real date values rather than text strings; otherwise Sheets may not order them chronologically.
Can I sort by two columns in Google Sheets?
Yes. Open Data > Sort range > Advanced range sorting options, choose the primary column, and use Add another sort column for the next key. The first key sets the main groups, and later keys order records within ties.
How do I keep the header row from sorting?
Include the header when selecting the range and check Data has header row in the advanced range-sort dialog. Alternatively, select only the data rows, taking care to include every column in each record.
Can Google Sheets sort automatically when I add data?
A menu sort does not maintain a live sorted order as new records are entered. For a separate automatically updated display, use the SORT function with the source range and place the result in an empty area. The original data stays in its existing order.
Related
- Excel Timesheet: How to Add Up Hours Correctly
- Excel Data Model Won’t Open? Causes and Fixes
- Excel Accounting Format: Make Negative Values Display in Red
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Schedule an Email Reply in OutlookTo schedule a reply in Outlook, open the message, choose Reply, write your response, and use Schedule send…
- Excel Dropdown List Examples and How to Create ThemExcel dropdown lists let people choose from approved entries instead of typing them by hand. In Microsoft Excel…
- How to Change Font View Size in Outlook on Any DeviceTo make email text easier to read in Outlook, enlarge the message view: in classic Outlook for Windows,…
- Excel Conditional Formatting for Drop-Down ListsTo color an Excel drop-down selection automatically, create the list with Data Validation, then add a conditional-formatting rule…
- Removing Duplicates in Google Sheets: A Practical GuideTo remove duplicate rows in Google Sheets, select your table, choose Data > Data cleanup > Remove duplicates,…
- How to Double Space in Word for the WebTo double-space text in Word for the web, select the paragraphs you want to change, open Home >…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.