Data Import & Export

Sort Numbers Stored as Text in Numerical Order in Excel

Anum MushtaqAnum Mushtaq Dec 2, 2026 869 views

Question details

Sort numbers stored as text in true numerical order in Excel.

Sort Numbers Stored as Text in Numerical Order in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A column contains values such as 1, 11, and 2 that need to be sorted from smallest to largest.
Observed behavior
Excel sorts the text values alphabetically, placing 11 before 2.
Before you start

Check whether the values are numbers only or include labels, and identify any leading zeros that must be preserved. Keep related columns together when sorting so each row stays intact.

Solution 1Recommended

Convert text to numbers with Text to Columns

Use this method to convert a column of numeric text in place before sorting it.

1
Select the values

Select the cells containing the numbers stored as text, excluding the column header.

2
Convert the column

Go to Data > Text to Columns. Check that the preview keeps each value in one column and that the column data format is General, then click Finish.

3
Sort the numbers

Select a cell in the converted column and choose Data > Sort Smallest to Largest. If prompted, choose Expand the selection to keep related rows together.

Convert text to numbers with Text to Columns
Leading zeros: Converting text to numbers removes leading zeros. If they are meaningful identifiers, keep the original text and sort using a numeric helper column instead.
Sort numeric text in WPS

Sort Numbers Stored as Text in WPS Spreadsheet

Use a VALUE formula in WPS Spreadsheet to create numeric sort keys, then sort the whole table while preserving the original text.

  1. 1. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel workbook.
  2. 2. Create a helper column: Insert a blank column beside the values and enter =VALUE(A2) in its first data cell, replacing A2 with the appropriate cell reference.
  3. 3. Fill the formula: Drag the formula cell's fill handle down to create a numeric key for each row.
  4. 4. Sort the table: Select the full table, choose Data > Sort, and sort by the helper column in ascending order.
Sort text-based numbers by their numeric valuesPreserve original text and leading zeros in a separate columnOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar spreadsheet interface for sorting and formulas
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel put 11 before 2?

Excel compares values stored as text character by character, so 11 can appear before 2. Convert the values to numbers or sort by a numeric helper column.

How can I sort numeric text without losing leading zeros?

Keep the original column as text. In a helper column, enter =VALUE(A2), fill the formula down, and use Data > Sort to sort the full table by the helper column.

Can I sort cells such as 2 apples and 11 apples numerically?

Yes. If a space separates each leading number from its label, enter =VALUE(LEFT(A2,FIND(" ",A2)-1)) in a helper column, fill it down, and sort the full table by that column.

Why does the VALUE formula return an error?

The source cell may contain characters that cannot be interpreted as a number. Check the cell's contents and, if it includes a label, extract the numeric portion before applying VALUE.