If Excel’s A to Z command is not sorting the records you expect, first click a cell in the column you want to order and choose Data > Sort A to Z; if prompted, select Expand the selection. If the result is still wrong, check that the whole data range is included and that the values are stored consistently as text, numbers, or dates.
Filter and sort are different actions
Excel’s filter controls which records are visible; sorting changes their order. When you open a column’s filter arrow and choose Sort A to Z, Excel sorts the list by that column. The command does not mean “show only values from A to Z,” and it does not remove records. To show or hide particular values, use the checkboxes or search box in the filter menu instead.
This distinction helps explain several common surprises. A filter can be active while the records are sorted, so some rows are hidden even after a successful sort. Conversely, clicking the filter arrow and clearing a selection changes which records appear but does not necessarily put the entire list into alphabetical order. Look for filter icons in the header row and clear filters if you need to inspect every record.
In Microsoft 365 for Windows, you can sort from a header’s filter arrow or select a cell in the relevant column and use Data > Sort A to Z. The Home tab also has sorting commands under Home > Editing > Sort & Filter. On Mac, use the Data tab or a column’s filter menu; ribbon layout and keyboard shortcuts can differ by Excel version. In Excel for the web, sorting is available from the Data tab and filter menus, though some desktop options may not be present.
Check that Excel is sorting the entire list
A frequent cause of an apparently broken sort is a range that does not include all related columns. If you sort only the names column while leaving phone numbers, dates, or order totals in place, the records no longer match. Excel often detects neighboring data and asks whether to expand the selection. Choose Expand the selection so each row stays together. Choose Continue with the current selection only when the selected cells are genuinely independent.
Before sorting, check that the data is one continuous block: one header row, one record per row, and no completely blank rows or columns splitting the list. A blank row can make Excel treat the area above and below it as separate regions. If the list is not being detected reliably, select the full range yourself, including all columns that belong to each record, and then sort.
For a list you update regularly, convert the range to an Excel table with Insert > Table or Home > Format as Table. Confirm that My table has headers is selected when appropriate. Tables keep related columns together during sorting and usually expand when you add records directly below them. A table will not fix inconsistent data, but it reduces range-selection mistakes.
Verify the header row and sort command
Excel needs to know whether the first row contains field names such as “Customer” and “City” or actual data. In a table, the header row is built into the structure. For an ordinary range, open Data > Sort to see the Sort dialog and check My data has headers. If Excel treats a header as a record, or treats the first record as a header, the apparent sort order can be confusing. Use clear, unique column headings and avoid extra title rows inside the data block.
Also confirm that you chose the intended column. A to Z sorts text in ascending order; for numbers, ascending means smallest to largest, and for dates it means oldest to newest. The filter arrow belongs to a particular field, so opening the arrow in “Status” and selecting A to Z will sort by status—not by a neighboring “Name” column. The column you sorted by may also contain repeated values, leaving the order within those ties unchanged.
If you need a predictable order across ties, use Data > Sort rather than a single quick sort. Select the primary column under Sort by, then use Add Level to specify a secondary column. For example, sort first by Department A to Z and then by Last Name A to Z. This is a multi-level sort; it preserves rows while defining how records with the same department are arranged.
Look for numbers or dates stored as text
Values that look alike on screen may have different underlying types. For example, a column could contain the number 2 as a numeric value and “10” as text. Text sorting can place values in an order that seems wrong for quantities, because alphabetic comparisons do not behave like numeric comparisons. A green triangle in a cell may indicate a number stored as text; selecting the cell can show an error indicator with a Convert to Number option.
Dates can have the same problem. A real Excel date is stored as a number with a date format, while a date-looking string may be treated as text. Mixed date formats imported from different regions can make a column especially hard to interpret. If the dates sort in groups or appear out of sequence, check whether the cells are actual dates rather than text. Do not convert a whole column blindly if its values have different meanings or formats.
For imported data, inspect a few cells from the beginning, middle, and end of the column. Look for apostrophes, unexpected spaces, inconsistent decimal or date separators, and values aligned differently from their neighbors. Excel may display a text value that looks identical to a number, so changing the cell’s number format alone does not always convert it. Use a deliberate conversion method suited to the source data, then sort again.
Check for spaces, blanks, and unusual characters
Names can appear out of order because a cell begins with a space or contains an invisible character. A leading space can make “ Seattle” sort before “Albany,” even though the visible words suggest otherwise. Imported files may also include nonbreaking spaces or line breaks that are difficult to spot. Compare the cell contents with the source, and inspect suspicious values in the formula bar.
Blank cells do not mean the sort has failed. Excel places blanks at one end of an ascending or descending sort, and their position may make a list look incomplete. Check whether rows are hidden by a filter, whether cells are truly empty, and whether some cells contain formulas that return an empty string. A formula result that looks blank is not always the same as a genuinely empty cell.
Other structural issues can stop a sort or change what Excel can sort. Merged cells within a data range may prevent sorting, particularly when the merged areas are not identically sized. Unmerge cells in the records area and repeat the value where needed so each record has its own cell. If the worksheet is protected, sorting may be disabled or restricted; check Review > Unprotect Sheet, or ask the sheet owner whether sorting and filtering are permitted.
Reset filters and repeat the sort safely
When the sort result is hard to diagnose, return to a known state. First clear any active filters so all records are visible. In a column’s filter menu, choose Clear Filter From that column, or use the clear command on the Data tab if available in your ribbon. Then confirm the complete data range and sort the intended column. Clearing a filter is not the same as deleting rows; it restores visibility.
- Save the workbook, especially if the original order matters.
- Check the header row and remove blank rows or columns that split the list.
- Clear filters temporarily and confirm that all expected records are present.
- Select a cell in the target column, choose Data > Sort A to Z, and expand the selection if Excel asks.
- Inspect the first few and last few values, then check whether tied values need a secondary sort level.
On Windows, Ctrl+Shift+L toggles filters for a selected range in many current Excel desktop versions. Because shortcut behavior can vary by platform, keyboard layout, or version, use Data > Filter if the shortcut does not work. On Mac, the Data tab is the dependable route when the shortcut differs. Turning filters off and back on does not correct mixed data types or a range that excludes columns; those still need to be fixed.
When a custom order is better than A to Z
A to Z is not the right tool for every list. It sorts text alphabetically, but a workflow may require a business order such as “Urgent,” “Normal,” and “Low,” or a progression such as “Not started,” “In progress,” and “Done.” Alphabetical sorting would produce a different sequence. Use Data > Sort and select a custom order when the Sort dialog offers one, or add a helper column containing a numeric rank and sort by that rank.
Similarly, sorting by one column cannot arrange every aspect of the list. If you want cities alphabetically within each country, use a multi-level sort with Country as the first level and City as the second. If the sort seems inconsistent only among duplicate names, that may simply be because Excel has no instruction for ordering records with equal values. Add a second level such as date, ID, or surname to make the result explicit.
Frequently Asked Questions
Why does Excel sort 1, 10, 2 instead of 1, 2, 10?
If the entries are stored as text, Excel may sort them alphabetically rather than numerically. Check for numbers stored as text and convert them consistently before sorting. Changing the display format alone may not change the underlying text values.
Why does A to Z put some names at the top unexpectedly?
Check for leading spaces, hidden characters, or cells that contain values different from what is visible. A name beginning with a space can sort ahead of ordinary letters. Inspect suspicious cells and clean or correct the source values before repeating the sort.
Will sorting one column keep the rest of each row together?
It should when Excel expands the selection to include the whole list. If prompted, choose Expand the selection. Sorting only one selected column can separate its values from the related information in other columns, so verify the range before confirming.
Why is Sort A to Z unavailable or producing an error?
The worksheet may be protected, the selection may contain merged cells, or Excel may not recognize a suitable data range. Check sheet protection, unmerge cells in the list, and select a clean range with consistent headers. If the file is shared or restricted, you may need permission to change it.
Does clearing a filter restore the original row order?
No. Clearing a filter shows records that were hidden by the filter, but it does not necessarily undo a previous sort. If you need the original sequence, keep a copy before sorting or include an ID or original-order column that you can sort by later.
Related
- How to Move the Quick Access Toolbar in Excel (Windows)
- How to Move Down a Line in Excel: Cells, Rows, and Text
- How to Move Freeze Panes in Excel to Different Rows
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- Excel Freezing? Fix a Workbook That Stops RespondingIf Excel is freezing, first wait briefly to see whether it is finishing a calculation or loading a…
- Excel IRR #DIV/0! Error: Why It Happens and How to FixIf Excel shows #DIV/0! beside IRR, the error is usually in one of the cash-flow formulas or cells:…
- Excel Error: Why You Can’t Change Part of an ArrayThe Excel message “You can’t change part of an array” means the cell you are trying to edit…
- Why Is My MATCH Formula Not Working in Microsoft Excel?Most MATCH formulas fail because the match type is wrong, the lookup value differs from the data, or…
- Excel Cell Drop-Down Menu: Create and Fix OneTo add a drop-down menu to an Excel cell in Microsoft 365 for Windows, select the cell, choose…
- Excel Not Working After an Update? Causes and FixesIf Excel started crashing, freezing, displaying errors, or behaving differently after an update, first restart Windows and Excel,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.