To put numbers in numerical order in Excel, select the range or column, go to the Data tab, and click Sort A to Z (ascending) or Sort Z to A (descending). Excel will sort the numbers correctly as long as they are stored as numbers, not text. If the sort looks wrong, check for numbers stored as text, blank cells, or a header row that was included by mistake.

What You'll Need

  • Microsoft Excel (any recent version for Windows, Mac, or the web). The exact button labels can differ slightly by version and platform, but the Data tab and Sort options are consistent.
  • A worksheet containing the numbers you want to sort, ideally in a single column or a well-defined table.
  • Optional: a header row so you can tell Excel to keep the header out of the sort.

Step-by-Step

  1. Select the data. Click the first cell of the column you want to sort, then drag down to the last cell. If your data has a header, include the header row in the selection so Excel can detect it. Alternatively, click any single cell inside the column and Excel will expand the selection automatically during sorting.
  2. Open the Data tab. On the ribbon, click the Data tab. This is where the sorting and filtering tools live.
  3. Choose a quick sort. For a simple ascending sort, click the Sort A to Z button (an A above a Z with a down arrow). For descending, click Sort Z to A. Excel will reorder the selected cells from smallest to largest or largest to smallest.
  4. Use the full Sort dialog for control. If you need to sort by a specific column, keep rows together, or handle headers, click Sort (the larger button with a dialog icon) instead of the quick buttons. In the dialog, tick My data has headers if your selection includes a header row. Then set Sort by to the column containing your numbers, Sort On to Cell Values, and Order to Smallest to Largest or Largest to Smallest. Click OK.
  5. Check the result. Scan the column to confirm the order is correct. If the numbers are stored as text, they may sort alphabetically (1, 10, 2) instead of numerically. See Troubleshooting for how to fix that.
  6. Sort multiple columns together. If your numbers sit next to related data (names, dates, amounts), select the entire table before sorting, or use the Sort dialog and choose the column to sort by. This keeps each row intact instead of scrambling the associated data.
  7. Undo if needed. Press Ctrl+Z (Windows) or Command+Z (Mac) immediately if the sort produces an unexpected result. Sorting cannot be undone after you save and close the file, so verify before saving.

Common Mistakes

  • Sorting only one column in a table. If you select just the number column and sort, Excel may ask whether to expand the selection. Choosing Continue with the current selection will reorder the numbers but leave the adjacent names or dates in place, breaking the row relationships. Always expand the selection or select the whole table.
  • Numbers stored as text. A column that looks like numbers but is formatted as text will sort alphabetically: 1, 10, 100, 2. The quick fix is to convert the text to numbers (see Troubleshooting).
  • Including the header row in the sort. If you select the header along with the data and do not tick My data has headers, the header text may be sorted into the data or the data may be treated as having no header, shifting everything. Use the Sort dialog and tick the header option.
  • Leaving blank rows or cells inside the range. Excel may treat a blank row as the end of the data, so rows below it are not sorted. Remove blank rows or select the full intended range explicitly.
  • Forgetting to check merged cells. Merged cells can prevent sorting or produce an error. Unmerge cells before sorting, then remerge if needed.

Tips

  • Use Sort A to Z and Sort Z to A for quick one-column sorts; use the full Sort dialog when you need to preserve row integrity or sort by multiple levels.
  • To sort by more than one column (for example, by department, then by salary), click Add Level in the Sort dialog and set the second column and order.
  • If you sort often, convert your range to an Excel Table (Ctrl+T or Command+T). Tables remember the header row and expand automatically as you add data.
  • Use Custom Sort only for special orders (days of the week, months). For plain numbers, the standard smallest-to-largest option is correct.
  • Before sorting a large dataset, make a copy of the sheet or save a backup. Sorting is easy to undo immediately, but harder to reverse after further edits.

Troubleshooting

The numbers sort as 1, 10, 2. They are stored as text. Select the column, then use Data > Text to Columns, click Finish without changing settings, and Excel will convert the values to numbers. Alternatively, multiply the range by 1 using Paste Special, or use the error-checking green triangle and choose Convert to Number. After conversion, sort again.

Excel says "The operation requires the merged cells to be identically sized." Unmerge the cells in the range, sort, then remerge if necessary. Merged cells interfere with sorting because Excel cannot move individual cells within a merged block.

Only part of the column sorted. A blank row or a break in the data likely stopped the selection. Select the entire range manually, including all rows, and sort again. Also check that the range does not contain hidden rows that were excluded.

The header row moved into the data. Undo, then use the Sort dialog and tick My data has headers. If the header is still treated as data, make sure the header row contains text and the rows below contain numbers; Excel usually detects this, but not always.

Sort options are greyed out. The sheet may be protected or the workbook may be shared. Go to Review > Unprotect Sheet (you may need a password) or stop sharing the workbook before sorting.

Sorting does not change the order. Check that the cells are not formulas returning text, and that the range you selected actually contains the values you see. If the values are calculated, sort by the underlying values or convert to static values first.

Frequently Asked Questions

How do I sort numbers in ascending order in Excel?

Select the range, go to the Data tab, and click Sort A to Z. For a controlled sort, open the Sort dialog and choose Smallest to Largest.

Why does Excel sort 10 before 2?

Those values are stored as text, so Excel sorts them alphabetically. Convert the column to numbers using Text to Columns or Convert to Number, then sort again.

Can I sort by numerical order without mixing up the adjacent columns?

Yes. Select the entire table (or click a single cell and let Excel expand the selection), then sort. In the Sort dialog, tick My data has headers and choose the number column as the sort key.

How do I sort a column that contains both positive and negative numbers?

Use the standard Smallest to Largest sort. Excel places negative numbers before positive ones, which is the correct numerical order.

Does sorting work the same on Excel for the web and mobile?

The core steps are similar, but button locations and labels can vary. On Excel for the web, the Data tab includes Sort options. On mobile, look for the sort icon in the toolbar or the cell context menu. The exact wording may differ by version and device.

What happens if I sort a column with formulas?

Excel moves the formulas with their rows, so relative references usually stay correct. However, if formulas refer to specific cells outside the sorted range, those references may not update as expected. Check the results after sorting, or convert formulas to values first if you need a fixed order.