Function Problems

Sort Text Labels by Numeric Value in Excel 2019

John WilsonJohn Wilson Dec 2, 2026 869 views

Question details

Sort text labels by their numeric suffix in ascending order rather than alphabetically.

Sort Text Labels by Numeric Value in Excel 2019
Product
Microsoft Excel 2019
Device & OS
not provided
Scenario
A column contains labels such as Person 1, Person 101, and Person 3, and the user wants to sort them by the numbers.
Observed behavior
A text sort places Person 101 before Person 3 instead of sorting the numeric suffixes in ascending order.
Before you start

Check that the labels follow a consistent pattern, with the number after the first space. These steps assume the labels are in column A, with a header in A1 and the first label in A2.

Solution 1Recommended

Sort labels using a numeric helper column in Excel 2019

Extract each numeric suffix into a helper column, then sort the full table by that column.

1
Add a helper column

Insert a new column next to the labels and enter a header such as Sort Number in B1.

2
Extract the number

In B2, enter =VALUE(MID(A2,FIND(" ",A2)+1,LEN(A2))) and press Enter.

3
Fill the formula down

Drag the fill handle from B2 down to the last row of labels.

4
Sort the full table

Select the entire data range, including related columns and headers. Go to Data > Sort, check My data has headers, select Sort Number, and choose Smallest to Largest.

Sort labels using a numeric helper column in Excel 2019
Formula requirements: The formula expects a space followed by a numeric suffix. Labels without that pattern may return an error.
Sort labels in WPS Spreadsheet

Sort numeric text labels in WPS Spreadsheet

Use a helper column in WPS Spreadsheet to extract numeric suffixes and sort labels in ascending numeric order.

  1. 1. Open the spreadsheet: Open WPS Office, launch Spreadsheet, and open your Excel file.
  2. 2. Create a helper column: Add a column next to the labels, with a header such as Sort Number.
  3. 3. Extract the suffixes: Assuming the first label is in A2, enter =VALUE(MID(A2,FIND(" ",A2)+1,LEN(A2))) in B2 and fill it down.
  4. 4. Sort by number: Select the full table, open Data > Sort, and sort the helper column from smallest to largest.
Sort labels by their numeric suffix instead of text orderOpen and save Microsoft Excel XLSX filesUse familiar spreadsheet formulas and sorting toolsWork in a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does Person 101 appear before Person 3?

Excel sorts the labels as text, comparing characters from left to right. Extracting the suffix into a numeric helper column lets you sort by its value instead.

Will sorting the helper column move the rest of each row?

Yes, if you select the entire table before choosing Data > Sort. This keeps the labels and related data together.

What if the formula returns an error?

Check that each label contains a space followed by a numeric suffix, such as Person 3. The formula uses FIND to locate the first space and VALUE to convert the remaining text to a number.

Can I remove the helper column after sorting?

Yes. Once the rows are in the desired order, select the helper column and delete it if you no longer need it. Add it again if you need to repeat the numeric sort later.