Home life · Updated
How to Alphabetize in Excel: Sort A-Z in Minutes
Quick answer To alphabetize in Excel, select your data, go to the Data tab, and click the A→Z sort button. This instantly sorts rows alphabetically by the selected column.
Alphabetizing in Excel organizes your data so you can find entries quickly, spot duplicates, and prepare clean lists for reports or mail merges. This guide covers sorting a single column, sorting an entire table without breaking row relationships, and fixing common sorting problems. You only need Excel (desktop or web) and a dataset with headers.
What You’ll Need
- Microsoft Excel (2016 or later, or Excel for the web)
- A worksheet with data you want to sort (e.g., names, products, cities)
- Optional: a header row that labels each column
Step-by-Step
- Select the data range. Click and drag to highlight all cells you want to sort, including the header row if you have one. If your data is a proper Excel table (created with Ctrl+T), just click anywhere inside it.
- Open the Sort options. Go to the Data tab on the ribbon. In the Sort & Filter group, you’ll see two buttons: A→Z (ascending) and Z→A (descending).
- Click A→Z for ascending order. This sorts alphabetically from A to Z (or 0 to 9 for numbers). If you have a header row, Excel usually recognizes it and keeps it at the top.
- Check the sort warning (if it appears). If you selected only one column but your data has multiple columns, Excel asks: “Sort anything that looks like the rest of the range?” Choose Expand the selection to keep rows together, or Continue with current selection to sort only that column (which can scramble your data).
- Use the Sort dialog for more control. For multiple levels (e.g., sort by Last Name, then First Name), click Sort in the same group. In the dialog, choose the column to sort by, the sort order (A to Z), and click Add Level to add another column.
- Sort by a specific column in a table. If your data is an Excel table, click the drop-down arrow in the header of the column you want to sort. Choose Sort A to Z from the menu.
- Handle case sensitivity (optional). By default, Excel ignores case. To make uppercase letters sort before lowercase, open the Sort dialog, click Options, and check Case sensitive. Then sort as usual.
- Undo if needed. If the sort didn’t do what you expected, press Ctrl+Z (or Cmd+Z on Mac) immediately to revert.
Common Mistakes
- Selecting only one column when you have multiple columns. This can scramble your rows, mixing up names with addresses or prices. Always select the entire data range or use “Expand the selection.”
- Forgetting to include the header row. If you select data without the header, Excel may sort the header as a regular row, moving it to the bottom.
- Hidden rows or columns. Sorting with hidden rows can leave them unsorted or cause errors. Unhide everything before sorting.
- Merged cells. Merged cells can cause sorting to fail or produce unexpected results. Unmerge cells before sorting.
- Blank rows or columns within the data. These can break the sort, treating blanks as separate blocks. Ensure your data is contiguous.
Tips
- Always keep a backup. Before sorting a large or important dataset, copy the sheet (right-click the tab → Move or Copy → Create a copy) so you can restore if something goes wrong.
- Use Excel Tables. Convert your data to a table (Ctrl+T) before sorting. Tables automatically expand the selection, keep headers fixed, and make sorting safer.
- Sort by multiple columns. To sort by Last Name and then First Name, use the Sort dialog. This is more reliable than sorting twice (which can undo the first sort).
- Check for leading spaces. Extra spaces before text can cause odd sorting. Use the TRIM function or Find & Replace to remove them.
- Sort numbers as text. If numbers are stored as text, they may sort as 1, 10, 2. Convert them to numbers (select column → Data tab → Text to Columns → Finish) or use the Sort dialog and choose “Values” for the sort order.
Troubleshooting
Sort didn’t affect all rows. If only part of your data moved, you likely selected only a few columns. Undo (Ctrl+Z) and reselect the entire range, then sort again.
Header row got sorted into the data. This happens when Excel didn’t detect a header. In the Sort dialog, check the box My data has headers at the top right. If you used the A→Z button, select the header row first and then press Ctrl+Shift+L to add filters, which respects headers.
Sort button is grayed out. This usually means your worksheet is protected or you’re in edit mode (e.g., double-clicked a cell). Press Enter to exit edit mode, or unprotect the sheet via Review → Unprotect Sheet.
Data sorted but rows are misaligned. You probably chose “Continue with current selection” when prompted. Undo and redo with “Expand the selection.”
Sorting by a column with formulas gives unexpected order. Excel sorts by the displayed value, not the formula. If you need to sort by the result, copy and paste as values first (Paste Special → Values).
Alphabetical order seems wrong (e.g., “A1” before “A10”). This is a text sort issue. If you have alphanumeric codes, Excel sorts them as text. To sort naturally, you may need to extract the numeric part or use a custom sort.
Frequently Asked Questions
How do I sort alphabetically in Excel without messing up rows?
Select the entire data range (all columns and rows you want to sort), then go to Data → Sort. In the Sort dialog, choose the column to sort by and ensure “My data has headers” is checked if you have a header. This keeps each row intact.
Can I sort by last name when the cell has “First Last”?
Yes. Use the Sort dialog with the column containing the full name. Excel sorts by the entire cell content, so “John Smith” will sort under J, not S. To sort by last name, split the name into two columns using Text to Columns (Data → Text to Columns, choose Delimited, space) or use a formula like =RIGHT(A1, LEN(A1)-FIND(” “,A1)). Then sort by the new last-name column.
How do I sort in Excel alphabetically and keep rows together?
Select all columns in your data range (not just the column you’re sorting by). Then use Data → Sort and pick the column. Excel will reorder entire rows based on that column’s values.
Why is my Excel sort not alphabetical?
Common reasons: cells contain leading spaces, numbers are stored as text, or the sort range includes hidden rows/columns. Check for spaces using =TRIM(), convert text numbers to numbers, and unhide everything before sorting.
How do I sort by multiple columns in Excel?
Go to Data → Sort. In the dialog, click “Add Level” for each additional column. Set the first column as primary, then secondary, etc. For example, sort by Last Name, then First Name.
Can I sort alphabetically in Excel on a Mac?
Yes. The steps are the same: select your data, go to the Data tab, and click the A→Z button. On Mac, the Sort dialog is under Data → Sort. The keyboard shortcut for undo is Cmd+Z.
Related
Sources: Microsoft Support. Menus and buttons can differ slightly by version. Spotted something out of date? Tell us.