If Excel won't sort A to Z, the usual reason is that the data range is not being read as one clean table: either only one column is selected, the range contains blank rows or merged cells, or the values are stored as text rather than as proper numbers or dates. The quickest fix is to select the entire range (or click a single cell inside it), then use Data > Sort, choose the column and confirm A to Z. If that still fails, remove blank rows, unmerge cells, and convert text-formatted values to real values before sorting again.

What You'll Need

  • Excel on desktop (Windows or Mac) — the steps below use the desktop ribbon; the web version has the same Data > Sort option but fewer cleanup tools.
  • A worksheet where the data sits in a contiguous block, ideally with a single header row.
  • Access to the file without protected-sheet restrictions (if the sheet is protected, sorting is disabled until you unprotect it).

Step-by-Step

  1. Select the whole data block, not just one column. Click any single cell inside the data, then press Ctrl+A (Windows) or Command+A (Mac) once. Excel should highlight the entire contiguous range. If it selects the whole sheet, click inside the data again and use Ctrl+Shift+End from the top-left cell of the range instead. Sorting a single column is the number-one cause of rows falling out of alignment.
  2. Check for blank rows and columns. Press Ctrl+End to jump to the last used cell. If that lands far below or to the right of your data, you have stray formatting or empty rows that break the range into pieces. Delete those blank rows (right-click the row number > Delete) so the block is continuous.
  3. Unmerge any merged cells. Select the range and look for the Merge & Center button on the Home tab. If it is active, click it to unmerge. Excel cannot sort a range that contains merged cells and will show an error.
  4. Open Data > Sort. With the range selected, go to the Data tab and click Sort (the larger button that opens the Sort dialog, not the A-Z quick button). Labels can differ slightly by version, device or region, but the Data tab and Sort dialog are consistent across current desktop versions.
  5. Confirm the header setting. In the Sort dialog, tick My data has headers if your first row contains column names. This keeps the header row out of the sort. If you leave it unticked, Excel will sort the header into the data.
  6. Choose the column and order. Under Sort by, pick the column you want. Under Order, choose A to Z for text or Smallest to Largest for numbers and dates. Click OK.
  7. If the values are text, convert them first. Numbers or dates stored as text will sort in a strange order (for example, 10 before 2). Select the column, go to Data > Text to Columns, click Finish without changing anything, and Excel will coerce the values. Alternatively, use Data > Sort and check the Sort numbers and numbers stored as text separately option under Options.
  8. Remove leading spaces. Extra spaces at the start of a cell make A-to-Z sorting look wrong. Use Find & Select > Replace (Ctrl+H) with a space in Find what and nothing in Replace with, then Replace All — but only if you are sure no internal spacing matters. A safer method is a helper column with =TRIM(A2), then copy the results and paste as values.

Common Mistakes

  • Sorting only one column. This scrambles row relationships. Always select the full range or a single cell inside a contiguous block.
  • Leaving the header row unticked. Excel treats the header as data and sorts it into the list.
  • Ignoring hidden rows. Sorting includes hidden rows by default, which can move data you did not expect. Unhide and review before sorting.
  • Sorting text that looks like numbers. Values such as "001" or "1,000" may be stored as text and will not sort numerically until converted.
  • Forgetting merged cells. Merged cells block sorting entirely; unmerge before you start.

Tips

  • Convert your range to an Excel Table (Ctrl+T or Insert > Table). Tables expand automatically and keep headers out of the sort.
  • Use the small A-Z button on the Data tab only after selecting a single cell inside a clean table — it is faster than the dialog for simple sorts.
  • For multi-level sorts (for example, by last name then by date), use Data > Sort > Add Level.
  • Keep a backup copy before large sorts, especially if formulas reference specific rows.
  • If you sort often, add a filter (Data > Filter) so you can sort and filter without reselecting the range each time.

Troubleshooting

Excel says "This operation requires the merged cells to be identically sized." Unmerge all cells in the range, sort, then remerge if needed.

The A-Z button is greyed out. The sheet may be protected, or you may be in a cell outside the data range. Check Review > Unprotect Sheet, then reselect the range.

Sorting changes but the order still looks wrong. Check for leading spaces, text-formatted numbers, or hidden rows. Use TRIM and Text to Columns as described above.

Only part of the data sorts. A blank row or column is splitting the range. Delete blanks and try again.

Formulas break after sorting. Absolute references may point to the wrong rows. Review formulas with relative references, or convert the range to a Table so references adjust automatically.

Sorting is unavailable in the web version for some features. If a cleanup step is missing in Excel for the web, open the file in the desktop app to finish the sort.

Frequently Asked Questions

Why does Excel sort 10 before 2?

The values are stored as text. Convert the column with Text to Columns or change the cell format to Number, then sort again.

Can I sort a protected sheet?

Not until you unprotect it. Go to Review > Unprotect Sheet and enter the password if one is set.

Does sorting affect formulas?

Yes. Relative references move with the cells; absolute references stay fixed. Check formulas after sorting, or use a Table to keep references stable.

Why is the Sort button greyed out?

The sheet is likely protected, or the active cell is outside the data range. Select a cell inside the data and try again.

Can I sort by more than one column?

Yes. In the Sort dialog, click Add Level and choose the next column and order.

Will sorting include hidden rows?

By default, yes. Unhide rows first if you want to review them before sorting.