To alphabetize names in Google Sheets, select the full data range you want to keep together, then choose Data > Sort range > Advanced range sorting options. Choose the name column, select A to Z, and mark the header-row option if your selection includes column headings before sorting.
Sort a name list from A to Z
In Google Sheets in a web browser, the safest approach is to select the cells that contain the names and any related information in the same rows. For a simple list in column A with a heading in A1, select the range that includes the heading and names, such as A1:A25. Then follow these steps:
- Open the Data menu and choose Sort range, then Advanced range sorting options.
- If the first selected row contains a heading such as Name, check Data has header row.
- Under Sort by, select the name column or its heading.
- Choose A to Z, then click Sort.
The names should now appear in ascending alphabetical order, while the heading stays at the top if you identified it as a header. To reverse the order, use Z to A. If the list has no heading, leave the header option unchecked; otherwise, Sheets may treat the first name as a heading and leave it out of the sort.
For a one-column list with no associated data, you can select the names and use the corresponding A-to-Z sorting command in the Data menu. The advanced range dialog is still useful because it lets you confirm which column is being sorted and whether the first row is a header.
Keep each name with its row
A frequent sorting mistake is selecting only the name column when each person has other information beside their name. For example, a table might have Name in column A, Email in column B, and Department in column C. Sorting only A can rearrange the names without moving the matching email addresses and departments. The result looks alphabetized, but the records no longer belong together.
To prevent that, select the entire table range, such as A1:C25, and sort by the Name column in the advanced range options. Sheets moves each complete row as a unit. If you select only one column from a larger data set, Sheets may ask whether to expand the selection. Choose the option that expands it when the other columns contain information that belongs to the names.
When the table is large, check that the selection includes every row and every column in the records. A note or total row beneath the data can be accidentally included, while a last record just outside the selected range will remain unsorted. If your data has blank rows, those can also make it less obvious where the intended table begins and ends.
Include headers without sorting them as names
Column headings such as First name, Last name, or Customer should normally remain in the first row. Include the heading in the selected range and check Data has header row in the sorting dialog. The Sort by list can then show the heading, making it easier to choose the right field than relying on a column letter.
If the header option is unavailable or you prefer not to include the heading in the selection, select only the data rows beneath it. For example, select A2:C25 if row 1 contains headings. The first row of the selection is then a data row, so there is no need to identify a header. This method is straightforward, but remember to include every record and related column.
If the heading itself moves into the alphabetical list, undo the sort immediately with Ctrl+Z on Windows or Chromebook, then repeat the operation with the header setting corrected. On a Mac, use Command+Z. Undo is useful for correcting a recent sort, but it should not replace checking the selected range before sorting, especially if other edits have been made since.
Choose whether to sort by first or last name
Google Sheets sorts text by the contents of the selected cells. If each cell contains a full name in the usual first-name-then-last-name order, such as Maya Chen, the default sort uses the beginning of the cell. The list will therefore be organized by first name, not surname. A-to-Z sorting does not infer which part of a name is a family name.
To sort by surname, the most reliable setup is to store first and last names in separate columns. Select the full table, then choose the Last name column as the sort key. If the existing data has full names in one column, you can create a separate surname column, check the results carefully, and sort the entire table using that helper column. Do not assume that the last word is always a surname: names can contain multiple given names, compound family names, particles, suffixes, or different cultural naming conventions.
For a small, familiar list, manually adding a clearly labeled Last name column may be practical. For a large or important contact list, confirm how the names should be parsed before sorting. A misplaced space or an assumption about name structure can lead to incorrect ordering. Keep the original full-name column so the information remains readable and can be checked after the sort.
Use a formula to show an alphabetized copy
Sorting through the Data menu changes the order of the selected source rows. If you want to preserve the original order and display an alphabetized copy elsewhere, Google Sheets has the SORT function. With names in A2:A20, enter =SORT(A2:A20,1,TRUE) in an empty cell. It returns the names in ascending order based on the first column of the supplied range.
With names in A2:A20 and matching email addresses in B2:B20, enter =SORT(A2:B20,1,TRUE) in an empty cell. This returns the full rows sorted by the first column of the range, so each email remains beside the corresponding name. TRUE means ascending order; use FALSE for descending order. The formula displays a sorted result without rearranging the source data.
Leave enough empty cells below and to the right of the formula for its results to appear. Existing content in the output area can prevent the result from expanding. If you edit the source data, the formula result updates to reflect the new values. This makes SORT useful for reports and views where the source order should remain intact, while menu sorting is better when you want to permanently reorder the working table.
Sort by more than one field
A table can be sorted by a primary field and then a secondary field. For example, you might group a directory by department and alphabetize names within each department. Select the complete table, open Data > Sort range > Advanced range sorting options, and choose the first column to sort by. Use Add another sort column to choose the secondary field, then apply the sort.
The order of the sort keys matters. If Department is the first key and Name is the second, Sheets groups records by department and orders the names within those groups. If Name is first and Department is second, it orders all records by name and uses department to order records that have the same name. Consider what readers should notice first before choosing the primary key.
Multiple sort keys can also help with duplicate names. Sorting first by name and then by email, for instance, gives the repeated name entries a consistent secondary order. It does not remove duplicates or determine whether two records represent the same person; it only orders rows according to the fields you specify.
Common sorting problems and how to fix them
If the result looks out of order, first check which column was selected as the sort key. A full name column sorts by its first characters, and a table may contain a different column with a similar heading. Also inspect the selected range: rows left outside the range cannot move with the sorted data.
- Names and details no longer match: Undo, then select the full table and sort by the name column rather than sorting names alone.
- The heading appears among the names: Undo and mark the first selected row as a header, or select only the data rows beneath it.
- A few entries appear unexpectedly positioned: Look for leading spaces, extra spaces, punctuation, blank cells, or inconsistent spelling. Clean the source values before sorting if those differences are accidental.
- The order differs from a paper directory: Confirm whether the intended key is first name, surname, or another field. A-to-Z sorting cannot determine a naming convention by itself.
Text ordering can also be affected by characters such as apostrophes, hyphens, accents, and prefixes. If a list must follow a specific organizational or regional filing rule, test a few representative names and consult that rule rather than assuming that a basic A-to-Z sort will reproduce it. For consistency across a shared sheet, avoid mixing informal names, full legal names, and surname-first entries in the same field.
Menu sorting versus a formula
Use the Data menu when the table itself should be reordered and people will continue editing that sorted data. This is usually the simplest choice for a contact list, class roster, or inventory table. Sorting the entire range keeps each record intact, and a multi-column sort can group information in a controlled way.
Use SORT when the original order has meaning or needs to stay unchanged. A formula-driven copy can serve as an alphabetized directory while the source remains in entry order, such as the order in which registrations arrived. The tradeoff is that formula results occupy a separate output area and are not the same as manually editable source rows. If the sorted output needs to be shared as fixed values, copy it and use Paste special to paste values only.
In Microsoft Excel, similar tasks are available through its Sort controls and SORT function, but the interface and some behaviors differ. These instructions use Google Sheets in a browser and its Data menu; Excel ribbon paths should not be substituted for the Sheets menu path.
Frequently Asked Questions
How do I alphabetize names in Google Sheets without moving the header?
Select the range including the header, open Data > Sort range > Advanced range sorting options, and check Data has header row. Then sort by the name column A to Z.
Does A to Z sort full names by last name?
No. It sorts by the text from the start of each selected cell. For a full name beginning with the first name, sort by first name; use a separate surname column to sort by last name.
Can I alphabetize names while keeping phone numbers in the right rows?
Yes. Select the names and phone numbers together, then sort the full range by the name column. Sorting only the name cells can separate names from their corresponding numbers.
Can Google Sheets keep the original list and show a sorted version?
Yes. Use SORT in an empty area to generate a sorted copy. For names in A2:A20, =SORT(A2:A20,1,TRUE) returns an ascending list while leaving the original cells in place.
How do I sort names from Z to A?
In the sorting dialog, choose Z to A instead of A to Z. With the SORT function, use FALSE as its ascending-order argument.
Related
- Copy Excel to Word and Keep Formatting
- Copy Excel Sheet to Word: Methods and Formatting
- Copy and Paste Word to Excel: Tables, Text, and Formatting
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 Add a Shared Mailbox in Outlook on the WebTo add a shared mailbox in Outlook on the web, sign in with your work or school account,…
- How to Double Space in Word: Steps, Tips, and FixesTo double-space text in Word, select it and choose Home > Line and Paragraph Spacing > 2.0. To…
- Create an Email Distribution List in Outlook 365To create an email distribution list in Outlook 365, open People and choose New contact list in new…
- Unknown Range Name in Google Sheets: Causes and Fixes“Unknown range name” in Google Sheets means a formula contains a word or reference that Sheets is treating…
- Auto Forwarding in Outlook: Setup and Key OptionsTo set up auto forwarding in Outlook, open Settings, choose Mail > Forwarding, turn on forwarding, enter the…
- Outlook Reply Signature: How to Set One UpTo create a reply signature in Outlook, open your signature settings, create and save the signature, then choose…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.