How to Sort in Excel by Number Order Step by Step Guide

Formulas & functions · Updated November 20, 2026

To sort numbers in Excel, select a cell in the number column, then choose Data > Sort Smallest to Largest for ascending order or Data > Sort Largest to Smallest for descending order. If the numbers belong to rows of related information, select the whole table first—or accept Excel’s option to expand the selection—so the records stay together. Check that the values are real numbers, not text, before sorting.

What You’ll Need

  • An Excel workbook with the numbers you want to sort.
  • The related columns or rows, if each number belongs with other information such as a name, date, or product.
  • Microsoft Excel for Microsoft 365 on Windows for the menu paths below. Excel for Mac and Excel for the web have similar sorting commands, with minor interface differences noted where useful.

It is sensible to save a copy of important data before making a large change. Sorting is reversible with Undo immediately after the sort, but later edits can make it harder to restore the original order.

Step-by-Step

  1. Check how the data is arranged. Put each record on its own row and each type of information in its own column. For example, a list might have a header row with Name in column A, Quantity in column B, and Price in column C. Keep the header labels in the first row, and avoid blank rows or columns inside the data. This layout lets Excel identify the full block of related information and sort the number column without separating it from its row.
  2. Select a cell in the number column. If the range is a continuous, well-formed table, click any cell in the column you want to sort; you do not need to highlight the whole column. For example, click a quantity value in column B. If the data has empty rows, separate blocks, or extra columns that must remain aligned, select the entire data range, including all related columns, before sorting. Do not select only the number cells when the adjacent information needs to move with them.
  3. Choose the sort direction. Open the Data tab on the ribbon. In the Sort & Filter group, click Sort Smallest to Largest to put low values first, or Sort Largest to Smallest to put high values first. The ascending order is numerical: for example, 2 comes before 10, and 10 comes before 100. Excel moves the complete records when it recognizes the surrounding data as a range. If a warning appears asking whether to expand the selection, choose Expand the selection, then click Sort.
  4. Use the Sort dialog when you need more control. Click a cell in the data, then choose Data > Sort. In the dialog, check that My data has headers is selected if the first row contains labels. Under Column, select the number column by its header or column name; under Sort On, leave Cell Values selected; under Order, choose Smallest to Largest or Largest to Smallest. Click OK. This approach is especially useful when a sheet has several numeric columns and you want to confirm exactly which one controls the order.
  5. Confirm the resulting order. Scan the top, middle, and bottom of the sorted list. In an ascending list, values should generally increase as you move down; in a descending list, they should generally decrease. Check that a few records still have the correct names or other details beside their numbers. Duplicate values are allowed and will appear together; Excel does not remove duplicates when it sorts.
  6. Sort by a second number if there are ties. To order records by one number and then use another number to break ties, open Data > Sort. Set the primary column and order, then click Add Level. Choose the secondary column and its order, and click OK. For example, you could sort a results table by score from largest to smallest, then by completion time from smallest to largest. The second level affects records with matching values in the first sort column.
  7. Handle numbers arranged across a row, if needed. Most lists have numbers running down a column. If the values you need to sort run left to right across columns, open Data > Sort, click Options, choose Sort left to right, and confirm. Then select the row to sort by in the dialog and choose the order. This changes the order of columns across the selected range, so include the full set of rows that must stay aligned with those columns.

On Excel for Mac, select the data and use the Data tab’s sort controls or Data > Sort; the exact ribbon arrangement can differ slightly from Windows. In Excel for the web, select a cell in the range and use the Data tab’s ascending or descending sort command. For a table with several fields, use the Sort dialog if it is available in your version so you can specify the column and check the header setting.

Common Mistakes

  • Sorting only one column. If you select just the number cells and choose to continue with the current selection, names and other details may no longer match their original numbers. Undo immediately with Ctrl+Z on Windows or Command+Z on Mac, then sort the full table or expand the selection when prompted.
  • Including a header as if it were a value. A heading such as Quantity can be treated as data if Excel does not recognize the header row. In the Sort dialog, select My data has headers. If using the one-click sort, start from a cell within a clearly labeled table and check that the heading stays at the top afterward.
  • Assuming numbers stored as text will sort like numbers. Text-formatted values may sort separately from numeric values or produce an order that does not match the expected numerical sequence. A warning icon, left alignment, or inconsistent sorting can be clues, though formatting alone is not conclusive. Check the cell values and convert them if necessary.
  • Leaving gaps in the data. A blank row or column can make Excel detect only part of a list. Remove unnecessary gaps or select the entire intended range before opening the Sort dialog. Make sure the selection includes every column that belongs to each record.
  • Choosing the wrong numeric column. A table may have columns for quantity, price, and total. A quick sort uses the column of the active cell, which is easy to overlook. Use Data > Sort and inspect the selected column name before confirming.

Tips

  • Convert text values before sorting. If Excel displays a warning icon next to cells, select the affected cells and use the warning menu’s Convert to Number option when it is offered. You can also select the affected column and choose Data > Text to Columns, then complete the wizard without changing the delimiter settings. Check the result first, especially if the column contains identifiers, leading zeros, or codes that should remain text rather than become quantities.
  • Use a table for changing data. Select the data and choose Insert > Table, making sure the header option is correct. Tables provide filter and sort controls in their header row and typically include new adjacent rows as the table grows. Sorting from a table header is a convenient way to work with a changing list.
  • Keep original sequence information when you may need it. Add a temporary index column with 1, 2, 3, and so on before sorting. If you later need the starting order, sort by that index, then remove the temporary column if you no longer need it. This is useful when the workbook does not otherwise record the original sequence.
  • Be deliberate with blanks and errors. Decide whether blank cells should remain at one end of the sorted range and check any error values before sharing the result. Sorting changes position, not the underlying data; it does not fill missing numbers or correct errors.
  • Use filters to sort a subset. If the table has filters, filter to the records you want to inspect and sort the relevant column. Check whether the sort applies to the full table, including hidden rows, as needed for your task. Clear the filter afterward if you want to see all records again.

Troubleshooting

The order looks like 1, 10, 100, 2. Excel may be treating the entries as text. Inspect a few cells, look for warning icons, and try converting genuine numeric values to numbers. If values contain units or extra characters, such as 12 kg, clean the entries into a separate numeric column before sorting. Do not convert product codes or postal codes if their digits are labels rather than quantities.

Names no longer match their numbers. The sort may have affected only one column. Press Ctrl+Z on Windows or Command+Z on Mac right away, then select the full record range and sort again. If Undo is no longer available, restore a saved copy or use a reliable identifier to reunite the records; do not guess based only on their new positions.

The header moved into the list. Undo the sort, open Data > Sort, and make sure My data has headers is checked. Confirm that the first row of the selected range really contains the headings and that the selection does not start below or above the intended table.

Only part of the list changed. Look for blank rows, blank columns, merged cells, or a selection that stopped early. Undo if necessary, remove gaps that split the data, and select the full range. If the sheet has merged cells, unmerge them where practical before sorting; merged ranges can prevent a clean sort.

The sort command is unavailable or behaves unexpectedly. Check whether the worksheet is protected, whether you are editing a cell, and whether the selection includes merged cells. Exit cell editing with Enter or Esc, then try again. If a workbook is shared or restricted, you may need permission to change the sort order. Save a copy and test the sort there if the data layout is complex.

Negative values, decimals, or duplicates seem misplaced. Confirm that the cells are true numbers and compare their actual values, not just how they are displayed. A number formatted to show no decimal places can still contain decimal digits; ties may also be values that only look equal because the displayed format rounds them. Increase displayed decimal places temporarily or inspect the formula bar to check.

Frequently Asked Questions

How do I sort numbers from lowest to highest in Excel?
Click a cell in the number column and choose Data > Sort Smallest to Largest. If Excel asks whether to expand the selection, choose that option so related columns move with the numbers.

How do I sort numbers from highest to lowest?
Click a value in the column and choose Data > Sort Largest to Smallest. For a complex range, use Data > Sort and set the order explicitly.

Can I sort a number column without moving the other columns?
You can, but it usually breaks the relationship between values and their records. Do this only when the number column is independent. Otherwise, sort the complete table so each row remains intact.

Why does 10 appear before 2?
The values may be stored as text, so Excel is not comparing them as numbers. Convert genuine quantities to numeric values, then sort again. Preserve text for codes where leading zeros or digit order is meaningful.

How do I sort by two number columns?
Open Data > Sort, choose the first column and order, then click Add Level to choose the second column and its order. Excel uses the second level to order records tied on the first.

Can I sort numbers that run across a row?
Yes. In the Sort dialog, choose Options and Sort left to right, then select the row and order. Include all related rows so the columns remain together.

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.