To sort numbers in Excel, click 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 Excel asks whether to expand the selection, choose Expand the selection so each number stays with the rest of its row.
Excel sorts true numeric values by their value, not by the first digit: for example, 2 comes before 10 in ascending order. Before sorting, check that the cells contain numbers rather than text and that your table has clear column headings.
What You’ll Need
- An Excel workbook with a column of numbers to sort.
- If the numbers belong to records, such as names and scores, keep those columns together in a single table with a heading for each column.
- Microsoft Excel for Microsoft 365 on Windows. The same basic sorting options are available in Excel for Mac and Excel for the web, though button labels or ribbon layouts can vary slightly.
Step-by-Step
- Save or make a copy of the workbook. Sorting changes the order of the rows in the selected range. Saving first gives you a way back if the wrong range is sorted or the data is not arranged as expected. A sort is usually reversible with Undo, but it is safer to preserve an original copy when working with important records.
- Check how your data is arranged. Each record should occupy one row, with the number you want to sort in one column. For example, a class list might have Student in column A, Score in column B, and Date in column C. Include the headings in the data range, but do not include unrelated notes or a second table immediately above or below it.
- Click a cell containing a number in the column you want to sort. You usually do not need to highlight the entire column. If the numbers are part of a table or a continuous block of related data, Excel can detect the surrounding range. Avoid selecting only the number cells when the other columns in the same rows contain information that must stay together.
- Choose the sort direction. On the ribbon, select Data > Sort Smallest to Largest to put low values first, or Data > Sort Largest to Smallest to put high values first. In some ribbon layouts, the commands appear in the Sort & Filter group. You can also use Home > Sort & Filter and choose the corresponding sort command.
- Respond to Excel’s selection prompt if it appears. When Excel detects neighboring data, a Sort Warning may ask whether to expand the selection or continue with the current selection. Choose Expand the selection, then click Sort. This moves whole rows together. Choosing to sort only the selected cells can detach numbers from the names, dates, or other details they belong to.
- Check the result. Scan the first few and last few values, and check a few rows against their other columns. In ascending order, values should progress from lower to higher; in descending order, from higher to lower. If the sequence looks like 1, 10, 100, 2, 20, the values are probably stored as text rather than numbers. See Troubleshooting below before sorting again.
- Use the Sort dialog when you need more control. Click a cell in the data, then select Data > Sort. In the dialog, choose the number column in Sort by, set Sort On to Cell Values, and choose Smallest to Largest or Largest to Smallest under Order. If your first row contains headings, make sure My data has headers is selected. Click OK to apply the sort.
- Add a secondary sort if values repeat. In the Sort dialog, select Add Level. Set the first level to the main number column, then set the next level to another column, such as a name or date. This sorts by the number first and uses the second column to order rows that have the same number. Click OK when the levels are set.
For a formatted Excel table, click a cell in the number column and use its filter arrow to choose a numeric sort order. Sorting from a table’s column menu keeps the records in each row together. If you are using Excel for Mac or Excel for the web, look for the equivalent ascending and descending commands on the Data tab or in the column’s filter menu; the core process is the same.
Common Mistakes
- Sorting just one column in a multi-column list. This can make the numbers no longer match the names or details in their rows. Use the selection prompt to expand the range, or select the full data block before opening the Sort dialog. A structured Excel table is a good way to keep related columns together.
- Assuming digits always mean numbers to Excel. Values imported from websites, text files, or other systems may look numeric but be stored as text. Text can sort alphabetically, producing an order such as 1, 11, 2. Convert the values to numbers before sorting if you need true numerical order.
- Including a heading as if it were a value. A heading such as Score can end up in the sorted data if Excel does not recognize it as a header. In the Sort dialog, check My data has headers. When using a quick sort command, confirm that Excel keeps the heading at the top.
- Leaving out part of the table. A blank row or column can cause Excel to interpret the data as separate blocks. Remove unnecessary empty rows within the list, or select the complete range explicitly before sorting.
- Sorting a range with merged cells. Merged cells can prevent Excel from sorting a range normally. Unmerge the cells, fill the information into the appropriate rows, and then sort the complete data range.
- Expecting a number’s display format to affect its value. A value displayed as currency, a percentage, or a rounded number may still be sorted by its underlying numeric value. For example, a cell showing 2.0 may contain a value of 1.96. Check the formula bar or increase displayed decimal places if the order seems surprising.
Tips
- Use a table for lists you sort regularly. Select the data and choose Insert > Table, confirm whether the table has headers, and click OK. Table filter arrows make sorting easier and help keep new rows within the same data structure.
- Keep headings consistent and unique. Short, clear labels such as Quantity, Score, or Price make it easier to select the right field in the Sort dialog. Avoid blank heading cells when you use multiple sort levels.
- Use the Sort dialog for several conditions. Quick ascending or descending commands are convenient for one column. The dialog is better when you need to sort by one number and then break ties by another field, or when you need to confirm whether a header is included.
- Check for hidden rows and filters. A filter can hide records, and hidden rows can make the visible result look incomplete. Clear filters or review the full list if you need to verify that every record is included. Do not assume that sorting has removed or corrected filtered-out data.
- Keep an original order column when it matters. If you may need to restore the original sequence, add a column such as Original position and number the rows before sorting. You can later sort by that column to return to the earlier order.
- Understand blanks and ties. Blank cells do not behave like ordinary numeric values, and rows with equal numbers have no meaningful order unless you add another sort level. Decide how to handle blanks and specify a secondary key if the order of tied records matters.
Troubleshooting
The result looks alphabetical instead of numerical. The cells may contain numbers stored as text. Select a cell and look for an error indicator or a warning icon; if Excel offers Convert to Number, use it for the affected cells. You can also use Data > Text to Columns for a column of text-formatted numbers: choose Delimited, click Next twice, leave the column data format as General, and click Finish. Check a few values afterward, especially if the data uses decimal or thousands separators from a different regional format.
Rows no longer match their original details. Press Ctrl+Z immediately on Windows to undo the sort, then repeat it and expand the selection. On a Mac, use Command+Z. If you have made additional changes since sorting, or closed the workbook, Undo may not be available; restore the saved copy if you have one.
The heading moved into the data. Undo the sort, open Data > Sort, and select My data has headers. Make sure the selected range begins with the heading row and that the correct column is chosen in Sort by.
Some rows did not move. Look for blank rows or columns separating the list into blocks. Select the complete range manually, including all related columns, and sort again. Also check whether a filter hides rows that you expected to see.
Excel will not sort the range. Check for merged cells, protected worksheet settings, or a selection that includes incompatible data regions. Unmerge cells where necessary, check Review > Unprotect Sheet if the sheet is protected and you have permission to unprotect it, then select a clean rectangular range and try again.
Values that look identical appear out of order. They may have different underlying decimal values or different text characters, such as leading spaces. Increase the displayed decimal places to inspect numeric values. For text-formatted entries, check for spaces or inconsistent separators, clean the data, convert it to numbers, and sort again.
Frequently Asked Questions
How do I sort numbers from lowest to highest in Excel?
Click a number in the column and choose Data > Sort Smallest to Largest. Expand the selection if Excel asks so related row data stays together.
How do I sort from highest to lowest?
Click a number in the column and choose Data > Sort Largest to Smallest. For more control, use Data > Sort and choose that order in the dialog.
Why does Excel sort 1, 10, and 2 in that order?
Excel is likely treating those entries as text, so it sorts them by characters rather than numeric value. Convert the entries to numbers, then apply the sort again.
Can I sort numbers without moving the other columns?
You can, but doing so may break the connection between each number and its record. If the columns belong together, expand the selection and sort the whole row. Sort just one column only when the other columns are intentionally independent.
Can I sort numbers while keeping duplicate values together?
Yes. A normal sort keeps equal values grouped, though their order within the group may not be meaningful. Add a second level in Data > Sort if you want a consistent order among duplicates.
Does sorting change the numbers themselves?
No. Sorting changes the order of cells or rows, not the underlying numeric values. It can, however, disrupt a list if you sort only one column instead of the complete set of related rows.
Related
- How to Rank in Excel with RANK.EQ
- How to Randomize in Excel: Shuffle Lists and Numbers
- How to Rank in Excel When There Is a Tie: Two Methods
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- PMT Function in Excel: Example and Payment FormulaWith the loan amount in B2, annual interest rate in B3, and term in years in B4, enter…
- Excel Formula to Check Whether a Value Is in a ListWith list items in A2:A10 and the value to check in D2, use =IF(COUNTIF($A$2:$A$10,D2)>0,"Found","Not found"). COUNTIF checks whether…
- Split Function Renal Scan: Purpose and ResultsA split function renal scan is a nuclear medicine test that estimates how much each kidney contributes to…
- Average in Excel: Formulas, Examples, and Common FixesTo calculate an average in Excel, use =AVERAGE(B2:B10) if the numbers are in cells B2 through B10. The…
- Business Mileage Log Excel Template: Setup and FormulasA business mileage log Excel template can be a simple table that records each trip’s date, odometer readings,…
- How to Filter in Excel to Find the Exact Data You NeedTo filter in Excel, click a cell in your data, then choose Data > Filter; use the arrow…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.