To sort a column alphabetically in Excel, select any cell within the column, go to the Data tab, and click either Sort A to Z (ascending) or Sort Z to A (descending). That's the quickest method. However, if your data has headers, multiple columns, or you need a custom order, you'll want to use the more controlled Sort dialog box. This guide covers both methods, plus how to avoid common pitfalls like sorting only one column and breaking your data.

What You'll Need

  • A computer with Microsoft Excel installed (this works for Excel 2010 through Excel 365, and the steps are nearly identical on both Windows and Mac).
  • Your spreadsheet open with the data you want to sort.
  • A basic understanding of what your data represents (e.g., which row is the header row).

Step-by-Step: Quick Sort (Single Column)

  1. Open your Excel workbook and navigate to the worksheet containing the column you want to sort.
  2. Click any single cell inside the column you want to sort. For example, if your column is "Last Name" and it's column B, click any cell in column B that contains data. Do not select the entire column (clicking the letter B) unless you specifically want to sort only that column and not the adjacent data.
  3. Go to the Data tab on the ribbon at the top of Excel.
  4. In the Sort & Filter group, you'll see two buttons: A→Z (sort ascending) and Z→A (sort descending). Click A→Z to sort alphabetically from A to Z, or Z→A for reverse alphabetical order.
  5. Excel will automatically detect if your data has a header row. If it does, it will keep the header in place and sort only the data rows. If you don't have a header, it will sort everything, including the first row. If you need to control this, use the Sort dialog box method below.
  1. Select any cell within your data range (the whole block of data you want to sort, including headers). Do not select just one column if you have adjacent columns that belong together.
  2. Go to the Data tab and click the Sort button (it usually has an icon with an A and Z and a downward arrow). This opens the Sort dialog box.
  3. In the dialog box, look at the My data has headers checkbox at the top right. If your data has a header row, make sure this box is checked. If not, uncheck it.
  4. Under Column, choose the column you want to sort by from the dropdown list. If you didn't check "My data has headers," you'll see "Column A," "Column B," etc. If you did, you'll see the actual header names.
  5. Under Sort On, leave it as Values (this is the default and works for text).
  6. Under Order, choose A to Z for ascending or Z to A for descending.
  7. Click OK. Excel will sort the entire selected data range based on the chosen column, keeping rows intact.

Step-by-Step: Sorting by Multiple Columns (e.g., Last Name then First Name)

  1. Follow steps 1-3 above to open the Sort dialog box.
  2. Set up your first sort level (e.g., Column = "Last Name", Order = A to Z).
  3. Click Add Level (a button in the top left of the dialog box).
  4. A new row appears. Set the second level (e.g., Column = "First Name", Order = A to Z).
  5. You can add more levels as needed. The sort happens from top to bottom: the first level is the primary sort, the second level sorts within ties of the first, and so on.
  6. Click OK.

Common Mistakes

  • Sorting only one column and breaking row relationships. This is the #1 mistake. If you have a table with names in column A and phone numbers in column B, selecting only column A and hitting A→Z will reorder just the names, leaving the phone numbers in their original rows. The result is mismatched data. Always select any cell within the full data range, or use the Sort dialog box which automatically includes adjacent columns.
  • Forgetting to check "My data has headers." If you don't check this and you have a header row, Excel will treat the header as data and sort it along with the rest, often placing it at the bottom or mixing it in.
  • Having hidden rows or columns. If you have hidden rows, sorting may not work as expected because Excel only sorts visible cells. Unhide all rows before sorting.
  • Sorting merged cells. Excel will not sort ranges that contain merged cells. You'll get an error message. Unmerge all cells before sorting.
  • Numbers stored as text. If your column looks like numbers but sorts as text (e.g., 1, 10, 2, 20), the cells are formatted as text. You'll need to convert them to numbers first.

Tips

  • Use a Table. Convert your data range to an Excel Table (select the range, then press Ctrl+T on Windows or Cmd+T on Mac). Tables automatically expand when you add data, and sorting a column in a table always keeps rows together. It also adds filter arrows to headers, making sorting one click away.
  • Create a custom sort order. If you want to sort by something other than alphabetical (e.g., by weekday order: Monday, Tuesday, ...), use the Sort dialog box, choose "Custom List" under Order, and select or create your list.
  • Sort left to right. If you need to sort columns horizontally (e.g., you have months in row 1), select the rows, open the Sort dialog box, click Options, and choose "Sort left to right."
  • Undo is your friend. If a sort goes wrong, immediately press Ctrl+Z (Cmd+Z on Mac) to undo it. This works as long as you haven't made other changes after the sort.
  • Check for leading spaces. A space before a name (e.g., " Smith") will cause it to sort before "Adams" because a space has a lower character code than letters. Use the TRIM function or Find & Replace to remove leading spaces.

Troubleshooting

If the sort doesn't seem to do anything: Make sure the column you clicked contains actual text or numbers. If it's empty, there's nothing to sort. Also, check if the worksheet is protected. If it is, you'll need to unprotect it (Review tab > Unprotect Sheet) before sorting.

If you get an error like "This operation requires the merged cells to be identically sized": You have merged cells in your data range. Unmerge all cells (select the range, go to Home > Merge & Center dropdown > Unmerge Cells), then try sorting again.

If the sort puts numbers in a weird order (e.g., 1, 10, 100, 2): This is the classic text-formatted-number problem. Select the column, go to Data > Text to Columns, and just click Finish (this converts text to numbers). Alternatively, use the error indicator (yellow diamond) that appears next to the cells and choose "Convert to Number."

If the header row gets sorted into the data: You likely didn't check "My data has headers" in the Sort dialog box, or you selected the entire column including the header and used the quick sort button. Undo, then either check the box in the dialog box, or select only a single cell within the data (not the header) before using the quick sort.

If the sort is case-sensitive and you don't want it to be: By default, Excel ignores case when sorting text. If you want case-sensitive sorting, you need to use a formula or a custom list. For most users, the default is fine.

Frequently Asked Questions

How do I sort a column alphabetically without affecting other columns?

You can't do that without breaking your data. If you have other columns with related data, sorting only one column will misalign them. If you truly want to sort only one column and leave others untouched, you can copy that column to a new area, sort it there, and then copy it back. But this is rarely a good idea because it destroys row relationships.

Why does Excel sort numbers as text?

This happens when the cells are formatted as Text or when the numbers were imported from a source that stored them as text. You can fix it by selecting the column, using Text to Columns (Data tab) and clicking Finish, or by using the VALUE function in a helper column.

Can I sort by last name when the column has "First Last" in one cell?

Yes, but you'll need to split the names first. Use Text to Columns (Data tab) with a space delimiter to separate first and last names into two columns, then sort by the last name column. Alternatively, use a formula like =RIGHT(A1,LEN(A1)-FIND(" ",A1)) to extract the last name.

Does sorting work on filtered data?

Yes, but it only sorts the visible (filtered) rows. Hidden rows remain in their original positions. If you want to sort all data, clear the filter first (Data > Clear Filter).

How do I undo a sort?

Press Ctrl+Z (Cmd+Z on Mac) immediately after sorting. If you've done other actions since, you may not be able to undo. To prevent this, you can add a temporary column with sequential numbers (1,2,3...) before sorting, so you can sort by that column to restore the original order.

Is there a keyboard shortcut for sorting?

Yes. After selecting a cell in the column, press Alt+D+S on Windows to open the Sort dialog box. On Mac, the shortcut is Cmd+Shift+R (or you can use the ribbon). The quick A→Z sort doesn't have a dedicated shortcut by default, but you can add it to the Quick Access Toolbar.