To sort data in Google Sheets in a browser, select a cell in the table and choose Data > Sort range > Advanced range sorting options; choose the column and order, then click Sort. If you want the entire sheet rearranged by one column, use Data > Sort sheet and select an ascending or descending option instead.
The key is to sort complete rows, not just one column of a table. Sorting changes the order in which records appear, while keeping each row’s related values together when the correct range is selected. The sections below explain how to choose the right method, sort by several keys, work with filters, and avoid common mistakes.
What sorting does in Google Sheets
Sorting puts records into a chosen order: for example, names from A to Z, dates from newest to oldest, or sales figures from largest to smallest. In a typical table, each row represents one record and each column contains a field about that record. Sorting by a field should move the whole row so that the information stays associated.
For example, a task list might have columns for task, owner, due date, and status. Sorting only the due-date cells could leave the dates beside the wrong tasks. Sorting the entire table by the due-date column instead moves each task’s complete row. This distinction is the most important thing to check before sorting.
Google Sheets can sort a sheet or a selected range. A sheet sort affects the sheet’s rows, while a range sort is limited to the selected data. Either can be useful, but the appropriate choice depends on whether other information on the same sheet should move too.
Sort a complete range safely
For a table that occupies only part of a sheet, select a cell inside the table and use Data > Sort range > Advanced range sorting options. In the sorting panel, choose the field to sort by and specify A to Z or Z to A. If the first row contains column names, select the option indicating that the data has a header row. Then choose Sort.
Before confirming, check that the range shown covers every column and row in the table. Selecting a cell within a contiguous table often lets Sheets identify the range, but review it rather than assuming it found every intended row. If the table has a blank row or column splitting it, Sheets may treat the surrounding blocks as separate data.
- Click a cell within the table, or select the full table range.
- Choose Data > Sort range > Advanced range sorting options.
- Include the header-row setting if your first row contains labels.
- Choose the sort column and direction, then click Sort.
Use Data > Sort sheet when the intent is to reorder the sheet’s rows by a column. This is convenient for a single table occupying the sheet, but it can also move other row-based content elsewhere on that sheet. If a sheet contains separate tables or notes alongside the main data, a range sort is usually more appropriate.
Sort by more than one column
Multiple sort keys create a consistent order when values in the main column repeat. In the advanced range sorting options, select the primary column, then use Add another sort column to set a secondary key. The first key determines the broad grouping; the next key orders records within matching values. You can add further keys when needed.
For instance, a staff list could be sorted first by department A to Z and then by last name A to Z. Everyone in the same department will appear together, with names ordered inside each department. For an event schedule, sort first by date from oldest to newest and then by start time from earliest to latest.
Sort-key order matters. If you choose last name first and department second, names will be grouped across the whole list, not department-first. Think of the first key as the main arrangement and subsequent keys as tie-breakers. If two records match on every selected key, their relative order may not be a meaningful or dependable way to distinguish them; add a further field if a stable tie-break is important.
Use filters to sort while exploring data
A filter is useful when you want to sort or narrow a table without repeatedly opening the sort-range dialog. Select the table and choose Data > Create a filter. Filter controls appear in the header row. Open the control for a column and choose a sort order, such as A to Z or Z to A. The table’s rows are sorted together, and the filter menu can also let you show or hide records based on values.
Filters are especially helpful for shared working data: a reader can sort the table, then filter to show only one region or status. Remember that a filter changes what is displayed, not the underlying values. If rows seem to have disappeared, check the filter conditions before assuming that data was deleted.
For personal exploration of a shared sheet, a filter view can be less disruptive than changing the ordinary filter for everyone. In the browser, use Data > Filter views to create or manage one. Filter-view options can vary with access and the current sheet state. A normal sort, by contrast, changes the row order in the shared sheet, so collaborators may see that change too.
Create a live sorted copy with SORT
If you want the original table to stay in place while another area displays its records in sorted order, Google Sheets offers the SORT function. Unlike a menu sort, it returns a sorted result in the formula’s location and updates that result as the source data changes. Leave enough empty cells below and to the right for the result to expand; existing content in its way can prevent the array result from displaying.
For example, suppose A2:C5 contains four records, with names in column A, scores in column B, and teams in column C. If the rows are Ada, 82, Blue; Ben, 95, Red; Chen, 76, Blue; and Dee, 88, Red, enter =SORT(A2:C5,2,FALSE) in an empty cell. The second argument tells Sheets to sort by the second column of the selected range, and FALSE requests descending order. The returned rows are Ben (95), Dee (88), Ada (82), and Chen (76), with each name and team kept on the same row.
This formula creates a sorted view; it does not physically reorder the source cells. Use a menu sort when you want to rearrange the original records, and a formula when you need a separate, automatically refreshed display. If you edit the output area, the formula’s result may be blocked or replaced, so keep the formula and its spill area separate from manual entries.
Prepare data for reliable sorting
Sheets can sort text, numbers, and dates, but inconsistent data can make the result surprising. A number stored as text may not sort numerically with actual numbers. Dates entered as text may be ordered like words rather than as calendar dates. If a column contains a mixture of values, inspect the cell formats and how the values were entered before judging the sort as incorrect.
Also check for stray spaces, inconsistent spelling, and blank rows inside the table. Names such as “North” and “North ” can be treated as different text values because one includes a trailing space. Standardize entries when a column is meant to contain a consistent category. For dates, make sure entries are recognized as dates and use a consistent date convention, especially when a sheet is shared across regions.
- Keep one header row with clear labels, rather than repeating headers between groups of records.
- Avoid merged cells inside the sortable data; they can make ranges difficult to sort cleanly.
- Include all related columns and all intended records in the range.
- Check that the sort direction suits the data: A to Z for ascending text, or smallest to largest for ascending numeric values.
Sorting does not clean or correct the data. If two records represent the same customer under slightly different spellings, a sort may place them near each other, but it will not merge them or decide which spelling is right.
Common sorting problems and fixes
Only one column moved. This usually means only that column was selected or Sheets did not recognize the full table. Undo immediately with Edit > Undo, then select the whole data range and sort it again. Check that names, dates, and other fields remain aligned after the operation.
The header was sorted into the records. Reopen the advanced sorting options and mark that the range has a header row. If the header has already moved, undo the sort and repeat it with the correct setting.
Numbers or dates appear in an odd order. Check whether some values are stored as text, whether the column mixes types, and whether dates were interpreted according to the intended locale. A sort orders the underlying values Sheets recognizes, which may differ from how a value looks on screen.
Some rows were not included. Review the selected range for blank rows, blank columns, or records beyond the range boundary. Select the full table explicitly and rerun the sort. Also check whether an active filter is hiding rows; hidden rows can make the visible result confusing.
Menu sorting changes the sheet’s contents, so use Undo promptly if the result is wrong. In a collaborative sheet, another person’s edits may affect the available undo history or the current data state. For important records, consider making a copy of the sheet before a large reorganization.
Google Sheets and Excel sorting
The basic idea is similar in Google Sheets and Microsoft Excel: choose the data, identify a sort column, and set the order. The menu paths differ. In Google Sheets in a browser, use the Data menu paths described above. In Excel for Microsoft 365 on Windows, sorting commands are on the Data tab, including the Sort and filter controls; the exact dialog and labels are not the same as in Sheets.
Do not assume that a shortcut, menu label, or behavior from one app applies to the other. In either program, the central safety rule remains the same: include the whole record range when sorting a table, and identify whether the first row contains headers. A sorted formula view is also different from sorting the source data in both spreadsheet applications, though their available functions and syntax can vary.
Frequently Asked Questions
How do I sort alphabetically in Google Sheets?
Select a cell in the table, then choose Data > Sort range > Advanced range sorting options. Choose the name column, set A to Z, mark the header-row option if appropriate, and click Sort. Include the full table so each person’s other details move with the name.
Can I sort Google Sheets by two columns?
Yes. In the advanced range sorting options, choose the first column and use Add another sort column for the next one. The first selection sets the main order; the second sorts records that tie on the first field.
How do I sort without changing the original data?
Put a SORT formula in an empty area and point it at the source range. The formula displays a sorted copy, while the original cells remain in their existing order. Leave room for the result to expand.
Why is Google Sheets sorting only one column?
The selected range may include only that column, or the table may be split by blank rows or columns. Undo the change, select all columns and records in the table, then sort the selected range again.
Can collaborators see a sort in a shared Google Sheet?
A regular sort changes the sheet’s row order, so it can be visible to other collaborators. A filter view is useful for personal sorting and filtering without changing the shared sheet’s ordinary view in the same way.
Related
- Signature Line in Word Without the X Placeholder Symbol
- Insert a Square Checkbox in Word: Symbol or Clickable Box
- Insert a Personal Signature in Word for Mac: Steps & Tips
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 Split Screen in Google Sheets for Side-by-Side ViewsTo split a Google Sheets view, open the same spreadsheet in two browser windows, move each window to…
- How to Change the Background View in Outlook on Any DeviceTo change Outlook’s appearance, open its appearance or theme settings and choose a light, dark, or colored theme;…
- PowerPoint Template: How to Create Your Own DesignTo create your own PowerPoint template in Microsoft 365 for Windows, open a presentation, choose View > Slide…
- How to Delete a Second Blank Page in Microsoft WordTo delete a second blank page in Word, turn on formatting marks with Home > ¶ Show/Hide, find…
- Excel Cell Background Image: What Works and What Doesn’tExcel does not provide a picture fill for an individual cell. For a decorative image across a worksheet,…
- Excel Date Difference: Days, Workdays, and Inclusive CountsTo find the number of days between two dates in Excel, subtract the earlier date from the later…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.