To alphabetize rows in Google Sheets, select the whole table, open Data > Sort range > Advanced range sorting options, indicate whether the range has a header row, choose the column to sort by, and select A to Z. Sorting the complete table keeps each row’s related values together; selecting only one column can separate names from their associated details.
What Alphabetizing Rows Means
Most people asking how to alphabetize rows mean sorting a table vertically by the text in one column. For example, a contact list may have a name, email address, and city in each row. Sorting by the name column puts the records in alphabetical order while keeping each person’s email and city on the same row.
This is different from rearranging the cells across a row, such as putting several words in one row into alphabetical order from left to right. The usual Google Sheets sort commands sort records by rows, using values in a column as the sorting key. If your goal is to reorder cells horizontally, first consider whether the data should instead be arranged as a vertical list; changing the layout or using a separate helper area may be more appropriate.
Sorting changes the order in which records appear, but it does not remove them. It is also not the same as filtering: a filter hides records that do not meet a condition, while a sort reorders the records that are shown.
Sort a Table by One Column
- Open the spreadsheet in Google Sheets in a web browser.
- Select the complete data range, including every column that belongs to the records. For example, if a table occupies A1:D40, select A1:D40.
- Choose Data > Sort range > Advanced range sorting options.
- If the first row contains labels such as Name, Email, and City, check Data has header row.
- In Sort by, choose the column you want to use, such as Name.
- Choose A to Z for ascending alphabetical order, then click Sort.
For a simple, contiguous table, you can also select a cell in the table and use Data > Sort sheet > Sort sheet by column [letter], A to Z (the wording identifies the chosen column). This sorts the sheet by that column, rather than limiting the operation to a selected range. Use the range method when the sheet contains other tables or notes that should not move.
Choose Between Sorting a Range and a Sheet
A range is a selected block of cells; a sheet is the entire worksheet tab. The distinction matters when a sheet contains more than one independent area of information. Sorting a range lets you limit the change to the table you selected. Sorting a sheet can reorder rows beyond the table, including blank cells and other content in the same sheet.
Before sorting, check whether any notes, totals, or separate tables share the same rows as your data. If they are part of each record, include their columns in the selected range so they travel with that record. If they are unrelated, do not include them in a range sort. When using a sheet-wide sort, make sure the sheet is organized as one continuous table and that unrelated content will not be affected.
For example, suppose A1:C20 contains a customer list, while E1:F5 contains a separate lookup table. Select A1:C20 and sort that range by its customer-name column. Sorting the entire sheet could move rows in the lookup area too, which may not be what you intend.
Handle Header Rows Correctly
A header names a field; it is not a data record. If your selection includes a header row but you do not identify it as a header, Google Sheets may sort the label into the records. In the advanced range sorting options, check Data has header row and choose the named field from the sort list. If you selected only data rows and left the header outside the selection, do not mark the selection as having a header.
Headers should be in the first row of the selected range. A blank row above the labels or merged cells can make it harder to select and sort a clean table. For reliable results, keep one header row, avoid blank rows inside the records, and use consistent column labels. If the header is frozen for scrolling, that does not automatically mean it is excluded from a sort selection; verify the actual range and the header option.
Sort by More Than One Column
Multi-column sorting is useful when a primary field has repeated values. For instance, sort an event list by date and then by event name, or sort a staff directory by department and then by last name. The first sort key groups the main categories; the next key orders records within each group.
In Data > Sort range > Advanced range sorting options, choose the first field and its direction, then use Add another sort column to add a secondary key. Choose the fields in priority order. With Department first and Last name second, records are grouped by department, and names are alphabetized within each department. A secondary key only matters when two or more rows have the same value in the earlier key.
You can add further keys when needed, such as department, last name, and first name. Make sure the range still includes every column in the records. Otherwise, the sort may leave related information behind instead of moving it with the row.
Alphabetize Without Reordering the Source Data
If you want an alphabetized view while leaving the original list untouched, use the Google Sheets SORT function in an empty area or on another sheet. It returns a sorted copy of the specified range, so edits to the source remain in their original order.
For example, assume A1:C5 contains a header row in row 1, and rows 2 through 5 contain four records with names in column A, email addresses in B, and cities in C. Enter =SORT(A2:C5,1,TRUE) in an empty cell. The first argument is the data range, 1 means sort by the first column within that range, and TRUE requests ascending order. The result is the same four complete records sorted by name; the header is not included, so add a header separately above the formula result if you want one.
Leave enough empty cells below and to the right of the formula for the results to expand. If another value blocks the output area, the formula cannot display the full result. For a descending order, change TRUE to FALSE. Unlike a menu sort, a formula-based result updates when the source data changes, though its displayed order is controlled by the formula rather than by manually moving the original rows.
Common Sorting Problems and Fixes
- Only one column moved: Undo immediately with Ctrl+Z on Windows or ChromeOS, then select the whole table and sort the range. On a Mac, use Command+Z. Sorting only the names column can mismatch names and other record details.
- The header appears among the names: Reopen the sort options and mark the header row, or select only the data rows and sort those without the header.
- Some records did not move: Check whether the selected range stopped short of the last row or left out columns. Expand the selection to include all records and fields.
- The order looks unexpected: Check for leading spaces, inconsistent spelling, or values that are not actually plain text. Clean the source values or use a consistent format before sorting.
- Numbers appear out of order: A column that looks numeric may contain numbers stored as text, or a mixture of text and numeric values. Make the values consistent before relying on a numeric sort.
- Blank rows split the table: Select the full intended range manually. A blank row can make it less obvious where a data block begins and ends.
If you spot a mistake, undo before making further edits. Once you have continued working, it may be safer to sort the correct range again or restore a previous version than to guess how to reconstruct the original order. For important sheets, make a copy before a major rearrangement.
Prepare Data for a Reliable Sort
Alphabetical sorting can only use the values Sheets has in the cells. Two entries that look alike may sort differently if one contains an extra space or a different character. Names with accents, punctuation, prefixes, or different spellings can also appear in an order that differs from a person’s preferred filing convention. For a casual list, the default A-to-Z result is usually sufficient; for a formal directory, decide on a consistent naming style first.
It helps to keep one type of information per column. Put full names in one field if you want to sort by the full name as written; use separate first-name and last-name columns if you need a specific last-name-first sorting order. Then choose the appropriate column, or use a secondary key where needed. Avoid merged cells and blank separator rows inside a table because they complicate range selection and make records harder to manage.
Sorting does not resolve duplicate records or correct misspellings. It simply places values in order, making duplicates and inconsistencies easier to notice. Review the list after sorting, especially if it contains dates, numbers, or a mix of data types.
Google Sheets Compared with Excel
The basic idea is the same in Google Sheets and Microsoft Excel: select the records, identify the sort column, and keep each record’s fields together. The menu paths and dialog wording differ. The steps in this guide use Google Sheets in a web browser, including its Data menu; do not look for Excel’s ribbon commands in Sheets. Excel for Microsoft 365 has its own sort controls, so follow Excel-specific instructions if you are working in that application.
Google Sheets is browser-based and can be used by collaborators in the same shared spreadsheet. If several people are editing, coordinate before changing a shared table’s order; a sort affects how everyone viewing that sheet sees the records. If collaborators need different views or should not rearrange the shared source, a separate sorted output or a filter view may be a better fit.
Frequently Asked Questions
How do I alphabetize a column without separating the other data?
Select the complete table, not just the column, and sort the range by the desired column. That keeps each row’s related values together.
How do I keep the header at the top when sorting?
Include the header in the selected range and check Data has header row in the advanced range sorting options. Alternatively, select only the records beneath the header.
Can I sort names by last name?
Yes, if last names are in their own column, choose that field as the sort key. If each full name is stored in a single cell, sorting uses the text in that cell; it does not automatically identify which part is the last name.
Can I alphabetize from Z to A?
Yes. In the sort options, choose Z to A for descending alphabetical order. For a SORT formula, use FALSE as the ascending-order argument.
Can I alphabetize rows automatically while keeping the original list unchanged?
Use a SORT formula in an empty output area, with the source range and sort column specified. The formula displays a sorted copy and updates as source values change.
Why did the sort separate my names and email addresses?
Most often, only the name column was selected. Undo the sort, select the full table, and sort the range by the name field so the entire record moves as one row.
Related
- Cover Page in Word: How to Insert, Edit, and Remove It
- Insert a Zigzag Line in Word: Steps and Formatting
- Insert a Table of Contents in Word and Keep It Updated
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Dropdown List: How to Select Multiple ItemsExcel’s standard Data Validation dropdown lets you select only one item at a time. To keep several selections…
- How to Add a Drop-Down List to an Excel TableTo add a drop-down list to an Excel table, select the cells in the table column, open Data…
- How to Create File Labels in Word: A Step-by-Step GuideTo create file labels in Microsoft Word, open Mailings > Labels, choose the label brand and product number…
- Add Checkbox in Excel: Steps to Insert and Link OneTo add a checkbox in Excel for Microsoft 365 on Windows, select the cell or range where you…
- How to Insert a Check Box in Word With a Keyboard ShortcutFor a quick, printable check box in Microsoft Word on Windows, type 2610 and press Alt+X; Word converts…
- How to Multiply a List of Numbers in Excel: 10 MethodsIf your numbers are in A2:A6, enter =PRODUCT(A2:A6) to multiply them all together in Excel. The methods below…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.