To sort a column alphabetically in Excel, click any cell inside the list, open the Data tab, and use the A to Z button (ascending) or Z to A (descending). Excel normally detects the surrounding block and sorts the whole row with it, so names stay lined up with their phone numbers, addresses or totals. The one thing to check first: every column needs a heading in row 1, and there should be no completely blank rows or columns splitting your list in two. If either of those is true, Excel may sort only part of the data and scatter values across rows.

The steps below use the desktop versions of Excel for Windows and Mac, which share the same Data tab layout. Labels can differ slightly by version, device or region, and the web and mobile apps hide some options behind different menus, so the differences are noted where they matter.

What You'll Need

  • Excel for Windows, Mac, the web, or the mobile app (a Microsoft 365 subscription or a one-off licence both work).
  • A list laid out with a single header row at the top and one type of information per column.
  • No fully blank rows or columns inside the block you want sorted — if you have them, select the exact range before sorting.
  • A backup copy or Ctrl+Z readiness, because sorting is easy to undo but harder to reason about after several other edits.

Step-by-Step

  1. Save a copy first. Press Ctrl+S (or Cmd+S on Mac) so you can close without saving if the result is wrong. Excel's undo works, but only until you make enough other changes.
  2. Click a single cell inside your data. Do not select the whole column by clicking its letter in the grey header, and do not select the entire sheet. One cell inside the block lets Excel work out the extent of the list automatically.
  3. Go to the Data tab on the ribbon. In the Sort & Filter group you will see the A → Z and Z → A buttons next to the Filter button.
  4. Click A → Z for alphabetical order. Excel sorts the column you are standing in, ascending, and moves the rest of each row with it. Z → A does the reverse. Text sorts A to Z, numbers sort smallest to largest, and dates sort oldest to newest.
  5. Watch for Excel's warning dialog. If Excel is not sure your list is a clean block, it asks whether to expand the selection or keep it as is. Choose Expand the selection when you want whole rows moved together. Choosing Continue with the current selection sorts only the highlighted cells and will break your rows apart — this is the single most common cause of scrambled data.
  6. Check the result against the first row. Pick one record before sorting, note the value in column A and what sits beside it in column C, and confirm they are still together afterwards. If they are not, press Ctrl+Z immediately and re-read step 2.
  7. For more control, use the full Sort dialog. With a cell in the list, click Data > Sort (the small icon with A, Z and an arrow, or the Sort button itself). In the dialog, tick My data has headers so the header row is excluded, then set Sort by to your name column, Sort On to Cell Values, and Order to A to Z.
  8. Add a second level if the first column repeats. Click Add Level, choose the secondary column (say, last name after department), and set its order. Excel then orders ties within each group, which is what you want for lists with duplicate surnames.
  9. Deal with blanks and case as needed. Blank cells land at the bottom in an ascending sort. Capital and lowercase letters are treated as the same letter in an ordinary sort, so “apple” and “Apple” sit together; use the Sort dialog's Options button and tick Case sensitive if that order matters to you.
  10. Remove the sort but keep the data if you change your mind. Press Ctrl+Z, or copy the range and paste it as values into a scratch sheet before sorting if you want to compare the two orders side by side.

Common Mistakes

Sorting a single column instead of the whole table. Selecting column A and hitting A → Z moves the names but leaves every other column untouched, so each row now holds one person's name and a different person's details. Always start from a cell inside the block and accept Excel's offer to expand the selection.

Leaving a blank row in the middle. Excel treats a blank row as the end of the data, so it sorts only the portion above it. Delete or fill blank rows first, or highlight the full range including everything below the gap before sorting.

Forgetting to mark the header row. If your title row gets sorted into the list, “Customer Name” appears between two surnames. In the quick A → Z button route, Excel usually detects a header automatically; in the Sort dialog, tick My data has headers yourself.

Sorting formulas that point at fixed cells. Rows that reference a single cell with absolute references, like =$Z$2, keep pointing at the same cell after the sort, so results no longer match the row. Sort the data first, then build the lookup formulas, and prefer references that move with the row.

Sorting a filtered list and assuming everything moved. When a filter is active, Excel sorts all visible and hidden rows within the filtered range, but rows outside the filter remain where they were. Clear filters (Data > Clear) before a big reorganising sort.

Tips

Use a table. Select your data and press Ctrl+T (or Insert > Table) to convert it into an Excel Table. Tables know their own boundaries, so the header and range detection problems disappear, and filters appear on every column automatically. A column header in a table also gets a small dropdown arrow with sort options built in.

Sort by last name by splitting the name first. If “Ada Lovelace” sits in one cell, alphabetical order sorts by first name. Add two helper columns with =TEXTBEFORE(A2," ") and =TEXTAFTER(A2," ") on newer versions, or use Data > Text to Columns with a space delimiter, then sort on the surname column. Older Excel versions use =LEFT(A2,FIND(" ",A2)-1) for the first name and a FIND/MID combination for the rest.

Sort by month or weekday names in their true order. A → Z puts April before January. Use the Sort dialog, set Order to Custom List, and pick the built-in month or weekday list so the calendar order is respected.

Sort left to right when your data runs across columns. Open Data > Sort, click Options, and choose Sort left to right. This is useful for wide layouts where each column is a record.

Keep numbers and text apart. Codes stored as text (order numbers with leading zeros) sort correctly as text but turn into numbers if Excel converts them; if a code like 0012 loses its leading zero, format the column as Text before entering or pasting values.

Troubleshooting

The rows came apart. Press Ctrl+Z at once. Then click inside the block, choose Data > Sort, and in the dialog confirm My data has headers is ticked and that the Sort by column is the one you meant. Sorting through the dialog is slower but harder to get wrong.

Excel says it cannot sort because cells are of different sizes, or merged cells are present. Merged cells in the sort range must be unmerged first: select the range, Home > Merge & Center dropdown > Unmerge Cells, then sort. This is non-destructive, but the merged layout will be lost.

Nothing happens when you click A → Z. Check that the sheet is not protected (Review > Unprotect Sheet, which needs the password if one was set) and that you are not in a cell outside the data or in a partially selected range. Also confirm the workbook is not open read-only.

Numbers sort as 1, 10, 2. Those values are stored as text, not numbers. Select the column, use Data > Text to Columns and click Finish to convert them, or multiply the range by 1 in a helper column and paste the results back as values.

Leading zeros or apostrophes appear. A leading apostrophe forces text. Removing it may strip zeros, so set the column format to Text before cleaning it up.

The sort looks right but a chart or summary changed. Charts referring to the original range follow the cells, not the records. If you moved data into a table, refresh any PivotTable built on it via PivotTable Analyze > Refresh.

Frequently Asked Questions

How do I sort alphabetically in Excel without mixing up the rows?

Click one cell inside the data, then use Data > A → Z, and choose Expand the selection if Excel asks. For certainty, use Data > Sort and tick My data has headers.

Does A → Z ignore capital letters?

Yes by default. Capital and lowercase are treated as the same character, so “apple” and “Apple” sit next to each other. Enable Case sensitive under Options in the Sort dialog to separate them.

Can I sort a column while leaving the rest of the sheet alone?

Yes, but only deliberately: select just that range first, then sort. Do not start from a cell in a larger table, because Excel will offer to include the surrounding data.

Why is my alphabetical sort putting blanks at the end?

Excel always places empty cells last in an ascending sort, which is normal. If you want them gone, filter them out rather than expecting the sort to hide them.

How do I undo an alphabetical sort?

Press Ctrl+Z immediately. Once you save and close, undo is gone, so keep a copy if the order is important.

Can I sort by surname when names are in one cell?

Not directly. Split first and last names into separate columns, then sort on the surname column. Sorting the combined text sorts by the first word.