Excel Sort A to Z: How Numbers Are Sorted

Formulas & functions · Updated November 19, 2026

In Excel, Sort A to Z sorts numeric values in ascending order—from the smallest number to the largest. Select a cell in the data, then choose Data > Sort A to Z; if Excel asks, choose to expand the selection so each row stays together. Numbers stored as text can sort differently, so check their cell values if the result looks unexpected.

What Sort A to Z means for numbers

“A to Z” is Excel’s familiar label for an ascending sort, even when the selected column contains numbers rather than letters. For genuine numeric values, ascending means low to high. For example, 3, 12, 45, and 120 sort in that order. Negative values come before zero, and decimals are compared by their actual numeric values: -2, 0, 0.5, 1.25, 10.

The opposite command, Sort Z to A, sorts numbers from largest to smallest. That is useful for rankings, such as finding the largest sales amount at the top. The button’s wording does not change what it does: choose the ascending or descending option according to the order you want.

Excel sorts the stored value, not just the way a cell looks. A value displayed as $25.00 is still a number if it was entered as a numeric value and formatted as currency. Likewise, a percentage such as 15% is stored numerically as 0.15. Formatting changes the display, not the underlying value used for sorting.

How to sort a number column safely

For a normal list, use the ribbon command while your data is selected as a whole. In Excel for Microsoft 365 on Windows, click a cell within the data and choose Data > Sort A to Z. You can also use Home > Sort & Filter > Sort A to Z. Excel generally identifies the connected data range and sorts its rows using the column containing the selected cell.

  1. Check that each row represents one complete record and that the column has a heading if your data includes headers.
  2. Click a cell in the number column. You usually do not need to select only that column.
  3. Choose Data > Sort A to Z for smallest to largest, or Data > Sort Z to A for largest to smallest.
  4. If Excel asks whether to expand the selection, choose Expand the selection to keep related values in each row together.
  5. Review the first and last values, and check that names or other fields still match their original records.

If you sort a formatted Excel Table, its rows stay together as the table is sorted. For an ordinary range, Excel may show an expand-selection prompt when adjacent columns contain data. Choosing Continue with the current selection sorts only the selected cells; that can detach numbers from the names, dates, or other information in the same rows. Use that option only when you deliberately want to reorder that column independently.

How Excel orders mixed and special values

A column can contain more than ordinary numbers. In an ascending sort, Excel orders numeric values from smallest to largest, then text alphabetically; logical values, errors, and blank cells follow their respective sort positions. Blank cells appear at the end of an ascending order. A date Excel recognizes as a date is stored as a number, so dates sort from earliest to latest with an ascending sort.

This matters when a column mixes actual numbers with labels. For example, a numeric 8 and a text entry such as “pending” are not comparable as two numeric amounts. Excel sorts each according to its value type. If a column is supposed to contain only amounts, mixed labels may signal that the data needs cleaning or that status information belongs in a separate column.

Numbers with the same value can appear in either order relative to one another after sorting; do not rely on a sort to create a meaningful order among ties. If ties need a consistent order, add a second sort level—for example, sort by amount first and then by date or name.

Why numbers stored as text sort strangely

One of the most common surprises is a column that looks numeric but contains text. Text values are compared as text, not by their mathematical size. That can produce an order such as 1, 10, 100, 2, because the first characters are compared alphabetically. A green triangle in a cell may flag a number stored as text, though indicators depend on Excel’s error-checking settings.

Text-number problems can come from importing a CSV or another system, entering an apostrophe before a value, or including spaces and other characters. A leading apostrophe can make Excel treat an entry as text while not displaying the apostrophe in the cell. Changing the number format to General or Number alone does not always convert existing text into numeric values; formatting and the stored data type are different things.

To investigate, select a suspicious cell and look at the formula bar and the number format. If Excel shows an error-checking icon, its menu may offer Convert to Number. For a whole column, select the cells and use Data > Text to Columns, then finish the wizard without changing the delimiter settings if no split is wanted. Another option is to use a temporary helper column to convert values, verify the results, and then replace the original data only if appropriate. Be cautious with identifiers such as postal codes, product codes, and account numbers: they may look numeric but should remain text when leading zeros or exact character sequences matter.

Sort a complete table by more than one column

Use the Sort dialog when you need to control the range, confirm whether it has headers, or sort by multiple criteria. Select a cell in the data and choose Data > Sort. In the dialog, check My data has headers if the first row contains field names, select the number column in Sort by, and choose the appropriate ascending order. Confirm the dialog to apply the sort.

To break ties, add a level in the same dialog. For example, choose Amount as the first sort level and Date as the next level. Excel then orders rows by amount and uses date to order rows that share an amount. You can add further levels when the data requires them, such as a final alphabetical ordering by customer. Make sure every level uses the intended column and order before confirming.

For a range that has no headers, leave the header option unchecked. If Excel mistakenly treats the first data row as a heading, that row may remain at the top rather than joining the sort. If the first row is a heading but Excel includes it in the sort, it can move among the values. The dialog is the clearest way to correct either situation.

Sort displayed results without changing the source

If you have Microsoft 365 or Excel 2021 and want a sorted copy rather than rearranging the original cells, the SORT function can return a sorted array. With records in A2:B6 and the numbers to sort by in column B, enter =SORT(A2:B6,2,1) in an empty area. The result spills into adjacent cells, returning the full rows in ascending order by the second column; the source range remains in place. The 1 specifies ascending order. Leave enough empty space for the returned rows and columns.

This approach is useful for reports that should update when source values change, but it is not a replacement for every manual sort. A spill result cannot be edited cell by cell like an ordinary copied range, and the formula can return a spill error if cells in its output area are occupied. The function is available in Microsoft 365 and Excel 2021 or later; older Excel versions may not support it.

Common sorting problems and how to fix them

  • Rows no longer match: Undo immediately with Ctrl+Z on Windows, then sort again and choose Expand the selection. On Mac, use Command+Z.
  • Values appear in an order like 1, 10, 2: Check whether the entries are numbers stored as text. Convert them only if they are genuinely quantities or values that should be numeric.
  • A heading gets sorted into the data: Open Data > Sort and set My data has headers correctly.
  • Some rows seem to be missing from the sort: Look for completely blank rows or columns separating parts of the range. Select the full intended range before sorting, or turn the range into a Table so its boundaries are explicit.
  • Numbers that look equal sort unexpectedly: Check for hidden decimal places, different underlying values, or values stored as text. Increase displayed decimal places or inspect the formula bar to diagnose the difference.
  • Dates sort in an odd order: Some entries may be text that resembles a date while others are real dates. Standardize the column’s values before sorting.

If you have already sorted incorrectly, undo before making further edits; once more changes are made, undo may reverse those as well. For important data, keeping a copy of the original range or workbook is a sensible precaution. A sort rearranges records, and the original row order is not automatically preserved as a separate field. If you may need it later, add an index column before sorting.

Frequently Asked Questions

Does Excel Sort A to Z sort numbers from lowest to highest?
Yes. When the cells contain real numeric values, the ascending command sorts from the smallest value to the largest. Choose Sort Z to A for the reverse order.

Why does Excel sort 1, 10, 2 instead of 1, 2, 10?
The entries are likely stored as text, so Excel compares their characters rather than their numeric values. Convert them to numbers if they represent quantities, then sort again.

Does sorting numbers also move the rest of each row?
It should when you sort a complete range or Table. If Excel asks, choose Expand the selection. Sorting only one column can separate values from the records they describe.

How do I sort numbers from largest to smallest?
Click a cell in the data and choose Data > Sort Z to A. In the Sort dialog, select the numeric column and choose descending order.

Can I sort numbers without changing the original list?
Yes. In Microsoft 365 or Excel 2021, SORT can return an ordered copy in an empty area. For example, with records in A2:B6 and the sort key in column B, =SORT(A2:B6,2,1) returns the rows ordered from low to high by that key.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.