Sort numbers in Excel using the Data menu
The fastest way to put numbers in order in Excel is to select the column or range containing your numbers, then use the Data menu and choose Sort. Excel will arrange them from smallest to largest (ascending) or largest to smallest (descending) in seconds. This works whether your numbers are in a single column, spread across multiple columns, or mixed with text.
The sort feature respects the structure of your spreadsheet — if you have headers or related data in other columns, Excel keeps rows together so your information doesn't scatter. You can also sort by multiple columns at once if you need to organize by one number first, then another.
Key Takeaways
- Select your numbers or the entire data range, click the Data menu, and choose Sort Ascending or Sort Descending to reorder instantly.
- Excel keeps related data in the same row together when you sort, so your spreadsheet structure stays intact.
- If your first row contains headers (like "Price" or "Date"), tell Excel to treat it as a header so it doesn't get sorted with your numbers.
- You can sort by multiple columns at once by opening the full Sort dialog and adding sort levels for each column you want to organize by.
- Sorting changes your spreadsheet permanently — if you need to keep the original order, save a copy first or use a filter instead.
Step-by-step: Sort a single column of numbers
Start by clicking on any cell in the column you want to sort. You don't need to select the entire column — Excel will figure out where your data ends. Then click the Data tab at the top of the ribbon.
In the Data tab, you'll see two sorting buttons near the left side: one with an arrow pointing up (Sort Ascending) and one with an arrow pointing down (Sort Descending). Click Sort Ascending to arrange numbers from smallest to largest, or Sort Descending to go from largest to smallest. Excel sorts immediately.
If your column has a header row (like "Sales" or "Temperature"), Excel usually detects it and leaves it in place. If it doesn't, a dialog box will appear asking whether your data has headers — click Yes if the first row is a header, or No if it's actual data.
Sort multiple columns while keeping rows together
When your spreadsheet has numbers in one column but related information in other columns, you need to sort the entire range so rows stay matched. Click on any cell in your data, then go to Data and click Sort (not the quick ascending/descending buttons — click the word "Sort" itself).
The Sort dialog box opens. Under "Sort by," choose the column containing the numbers you want to order. Make sure the box labeled My data has headers is checked if your first row contains column names. Then choose Ascending (smallest to largest) or Descending (largest to smallest) and click OK.
Excel sorts your entire data range by that column while keeping each row's information together. If you have 100 rows of customer data with names, addresses, and purchase amounts, sorting by purchase amount keeps each customer's full record in the same row.
Sort by multiple columns at once
Sometimes you need to organize by one number first, then by another. For example, you might sort by state first, then by sales amount within each state. Open the Data menu and click Sort to open the full dialog.
Under "Sort by," select your first column — the one that matters most. Then click Add Level at the bottom left. A second row appears where you can choose your second column. Set each one to Ascending or Descending as needed. You can add as many levels as you want, and Excel applies them in order from top to bottom.
When you click OK, Excel sorts by the first column, then within each group of the first column, it sorts by the second column, and so on. This is useful for organizing sales data by region and then by amount, or student records by grade level and then by test score.
Use AutoFilter to sort without changing your data
If you want to view your numbers in order without permanently rearranging your spreadsheet, use AutoFilter instead of Sort. Click on any cell in your data range, go to Data, and click AutoFilter. Small dropdown arrows appear in your header row.
Click the dropdown arrow in the column you want to sort. A menu appears with options like "Sort Smallest to Largest" or "Sort Largest to Smallest." Choose one, and Excel displays your data in that order. The original arrangement is still there underneath — if you turn off AutoFilter, your data returns to its original order.
AutoFilter is helpful when you're exploring data and don't want to commit to a permanent change. You can also use it to hide certain numbers and show only the ones you're interested in, then sort those visible rows.
Fix common sorting problems
If your numbers sort incorrectly — for example, 10 appears before 2 — the column is probably formatted as text instead of numbers. Excel treats text differently and sorts it alphabetically rather than numerically. To fix this, select the column, right-click, and choose Format Cells. Under the Number tab, select Number from the Category list and click OK. Then sort again.
If your header row got sorted along with your data, undo the sort immediately by pressing Ctrl+Z (or Cmd+Z on Mac). Then open the Sort dialog again, check the box for My data has headers, and sort once more. Excel will keep your headers in place this time.
If only part of your data sorted and the rest stayed in place, you probably selected only a portion of your range. Undo with Ctrl+Z, click on any cell in your full data range, and try sorting again without selecting specific cells first.
Frequently Asked Questions
Can I sort numbers in descending order (largest to smallest)?
Yes. Click on your data, go to Data, and click Sort Descending (the button with the down arrow). Or open the full Sort dialog and choose Descending instead of Ascending. Both methods work the same way.
What happens to my original data order when I sort?
Sorting permanently rearranges your spreadsheet. If you need to keep the original order, save a copy of your file before sorting, or use AutoFilter instead, which lets you view data in sorted order without changing it.
How do I sort by one column but keep other columns matched to the same rows?
Select any cell in your data range, open the Data menu, and click Sort (not the quick buttons). Choose the column you want to sort by, make sure "My data has headers" is checked, and click OK. Excel sorts the entire range while keeping rows together.
Why are my numbers sorting in the wrong order?
Your column is probably formatted as text. Select the column, right-click, choose Format Cells, select Number from the Category list, and click OK. Then sort again. Text sorts alphabetically (2 before 10), while numbers sort numerically (2 after 10).
Can I undo a sort if I change my mind?
Yes. Press Ctrl+Z (or Cmd+Z on Mac) immediately after sorting to undo. This restores your data to the order it was in before the sort. You can undo multiple times to go back several steps.