Excel lets you sort numerical data easily to see trends, compare values, or prepare reports. No matter whether your numbers are in a single column or spread across multiple, you can arrange them in ascending (lowest to highest) or descending (highest to lowest) order in just a few clicks. This works on Excel for Windows, Mac, or mobile apps, though mobile steps differ slightly from desktop.
What You'll Need
- An open Excel spreadsheet with numerical data.
- Excel (desktop app, Excel Online, or mobile app).
- Knowledge of your data’s arrangement (e.g., column headers, rows).
Step-by-Step
- Select your data range: Click and drag to highlight the cells containing numbers you want to sort. If your numbers are in columns (e.g., A1:B100), include the header row (e.g., A1:B101). Avoid selecting empty cells at the end, as Excel may include them in sorting.
- Go to the Data tab: In the desktop app, click the "Data" tab in the ribbon (above the formula bar). Mobile apps (Excel for iOS/Android) open the same "Data" tab via the menu bar at the top.
- Choose Sort:
- Desktop: Click "Sort" in the Data Tools group. Mobile: Tap "Sort" under the "Data" menu.
- For multi-column sorting (e.g., sort by column A, then B), click "Sort A to Z" (ascending) or "Sort Z to A" (descending) in the dialog box. To sort by multiple columns, click "Sort & Filter" > "Sort," then select multiple columns under "Columns to sort by."
- Set up the sort criteria:
- In the Sort dialog, choose:
- "My data has headers" to include the first row as labels.
- "Sort A to Z" (ascending) or "Sort Z to A" (descending) under "Sort by."
- If sorting by two columns (e.g., state first, then city), click "Options" > "Ascending" or "Descending" under "Sort order."
- In the Sort dialog, choose:
- Apply the sort: Click "OK." Excel will rearrange your data immediately. Mobile users tap "Sort" to confirm.
Common Mistakes
- Skipping headers: If you omit the header row (e.g., A1:B100 instead of A1:B101), Excel sorts only the data cells, hiding labels. Always include headers to preserve column titles.
- Empty rows/columns: Selecting rows/columns with blank cells may cause errors. Drag to include only filled cells.
- Incorrect sort type: Mixing ascending/descending for multiple columns breaks logic. Use "Options" to match sort orders.
- Formulas in data: If your "numbers" are actually formulas (e.g., `=B1*2`), the output may not match your expectation. Copy-paste the raw numbers into a new range before sorting.
Tips
- Sorting large datasets: For over 10,000 rows, use "Sort & Filter" > "Sort" > "Sort A to Z" and enable "Sort by color" (if applicable) to speed up processing.
- Conditional sorting: To sort only visible data (e.g., filtered rows), click "Sort & Filter" > "Filters" > "Sort"; Excel will only sort the currently displayed cells.
- Save as a template: After sorting, save your file with "File" > "Save As" to reuse the sorted layout later.
- Mobile shortcuts: Tap and hold a number to "Copy" it, then paste into a new range before sorting to avoid formula issues.
Troubleshooting
- Data not sorting: Check if your selection includes empty cells. Select cells only up to the last filled row/column.
- Sort errors in mobile: Restart Excel or tap "Settings" > "Reset" in the mobile app to clear cached data. If the issue persists, log out and back in.
- Sorting reverses unexpectedly: Verify your "Sort by" setting (e.g., "My data has headers" must be unchecked if you’re sorting only data cells).
- Excel freezes: Stop the sort and close the Data tab. Refresh the spreadsheet (press F5) or wait 30 seconds before retrying.
- Sorting fails with formulas:
- Copy the raw numbers into a new range (e.g., drag to A2:B101).
- Paste the copied data into your original selection.
Frequently Asked Questions
How do I sort numbers in Excel Online?
Open Excel Online, click the "Data" tab, then "Sort" under "Data Tools." Select your range, choose ascending/descending, and click "OK."
Can I sort numbers by date alongside other numbers?
Yes. Combine dates and numbers in one column (e.g., "2023-10-01 100," "2023-11-01 200"). In the Sort dialog, select the column, click "Options" > "Date" under "Sort order."
Why did my sort show blank cells?
Excel may include empty cells if your selection spans beyond filled data. Narrow your selection to only filled cells (e.g., drag to the last non-empty row).
How do I sort by numbers in a table?
If your data is in an Excel Table (Ctrl+T), click the "Data" tab > "Sort A to Z" or "Sort Z to A." Tables automatically include headers and handle sorting more efficiently than regular ranges.
What if my numbers are mixed with text?
Sort only the numerical values by selecting the entire range and excluding text cells. Right-click the selection > "Format Cells" > "Number" to ensure only numbers are sorted.
How do I undo a sort?
Press Ctrl+Z (Windows/Mac) or tap "Undo" in the mobile app to revert the sort. If the undo option disappears, try pressing the backspace key or closing and reopening the file.