Function Problems

How to Sort Excel Formula Results Numerically Instead of Alphabetically

Steve KSteve K Oct 29, 2026 871 views

Question details

The user wants to sort formula results numerically (Smallest to Largest) instead of alphabetically (A to Z).

How to Sort Excel Formula Results Numerically Instead of Alphabetically
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Filtering and sorting data generated by logical or text formulas in a worksheet.
Observed behavior
The filter menu offers 'Sort A to Z' and 'Sort Z to A' instead of numerical sorting options, treating the formula outputs as text instead of numbers.
Before you start

Select the column containing your formula results and ensure no cells are formatted as pure Text. You can also use the ISNUMBER function in an adjacent cell to check if your data is actually being recognized as numerical values before attempting to sort.

Solution 1Recommended

Remove Quotation Marks from Formula Outputs

Modify your IF statements or other formulas to output raw numbers instead of text strings wrapped in quotation marks.

The most common cause of numbers sorting alphabetically is the use of quotation marks around numeric outputs in formulas (e.g., =IF(A1<=1000,"1","2")). Excel treats anything inside quotation marks as a text string, which forces an A-to-Z sort.

1
Select the formula cell

Click on the first cell in your column that contains the formula you want to correct.

2
Edit the formula

Look at the formula bar at the top of the screen. Identify any numeric outputs that are wrapped in quotation marks.

3
Delete quotation marks

Remove the quotation marks around the numbers. For example, change =IF(A1<=1000,"1","2") to =IF(A1<=1000,1,2).

4
Apply to the column

Press Enter to apply the change, then double-click the small square fill handle at the bottom right of the cell to copy the updated formula down the rest of the column.

5
Re-apply your filter

Click the filter drop-down arrow on your column header. The sorting options should now properly display 'Sort Smallest to Largest' and 'Sort Largest to Smallest'.

Remove Quotation Marks from Formula Outputs
Correct Data Type: By removing the quotation marks, Excel instantly recognizes the output as a true numerical value, enabling mathematical operations and proper sorting.
Free and Easy Data Sorting

Easily Sort and Analyze Data with WPS Spreadsheet

WPS Spreadsheet provides robust data sorting, filtering, and formula evaluation tools. It perfectly handles numerical and text data, allowing you to seamlessly manage complex datasets and easily fix formatting issues without changing your workflow.

  1. 1. Open your document: Launch WPS Office and open your Excel workbook in WPS Spreadsheet.
  2. 2. Select your data: Highlight the column containing your formula results.
  3. 3. Enable filtering: Navigate to the 'Data' tab on the top ribbon and click on the 'AutoFilter' button.
  4. 4. Sort numerically: Click the filter drop-down arrow on your column header to access 'Sort Smallest to Largest' and organize your numeric data perfectly.
Fully compatible with Microsoft Excel formulas and file formats (.xlsx, .xls).Advanced filter and sort capabilities to easily organize numerical and text data.Built-in error checking to help identify text stored as numbers instantly.Free, lightweight, and fast performance, even for large datasets.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel sort my numbers like 1, 10, 11, 2?

This happens when your numbers are stored as text. Alphabetical (text) sorting evaluates characters character-by-character from left to right. Because the first character of '10' is '1', it places '10' before '2', just as 'Apple' comes before 'Banana'.

How can I quickly check if my formula results are text or numbers?

You can use the =ISNUMBER(cell_reference) formula in a blank adjacent cell. If it returns TRUE, the formula result is a real number. If it returns FALSE, the result is being treated as text.

Does changing the cell format to 'Number' fix this sorting issue?

Changing the cell format via the 'Format Cells' menu is often not enough if the formula explicitly outputs text strings. You must edit the formula to remove quotation marks or use a conversion function like VALUE() to permanently resolve the issue.