Function Problems

Sort Excel Labels by the Full Number Using Helper Columns

Steve KSteve K Dec 2, 2026 869 views

Question details

Sort technician labels by their initials and full numeric sequence rather than by text order.

Sort Excel Labels by the Full Number Using Helper Columns
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains labels such as JS1, JS2, and JS10 that need to be grouped by initials and sorted numerically.
Observed behavior
Excel sorts the labels as text, placing JS10 before JS2.
Before you start

Check that each label has exactly two initial characters followed by a number. The formulas below assume labels start in cell A2; adjust the cell reference if your labels are elsewhere.

Solution 1Recommended

Extract Initials and Numbers, Then Apply a Custom Sort

Use helper columns to sort labels with two-character initials by the full sequence number.

1
Create helper columns

Add columns named Initials and Sequence Number beside the label column, using B1 and C1 as headers in this example.

2
Extract the initials

In B2, enter =LEFT(A2,2) to extract the first two characters of the label.

3
Extract the sequence number

In C2, enter =--MID(A2,3,99) to extract the remaining characters and convert them to a number.

4
Fill the formulas down

Select B2:C2 and drag the fill handle down through all rows containing labels.

5
Sort the complete range

Select the full table, including the labels and helper columns, and choose Data > Sort. If headers are included, select My data has headers. Sort first by Initials from A to Z, then use Add Level to sort by Sequence Number from smallest to largest.

Extract Initials and Numbers, Then Apply a Custom Sort
Labels with different initial lengths: These formulas require exactly two initial characters. If initials vary in length, separate the initials and number during import or use a pattern-based extraction before sorting.
Sort labels in WPS Spreadsheet

Sort Technician Labels Numerically in WPS Spreadsheet

Use helper formulas and a multi-level sort in WPS Spreadsheet to group labels by initials and order their full sequence numbers.

  1. 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
  2. 2. Add helper columns: Add Initials and Sequence Number headers beside the labels. If labels begin in A2, enter =LEFT(A2,2) in B2 and =--MID(A2,3,99) in C2.
  3. 3. Fill the formulas: Select B2:C2 and drag the fill handle down to the last label row.
  4. 4. Apply the sort: Select the entire table and choose Data > Sort. Set Initials to ascending order, then add Sequence Number as a second ascending sort level.
Sort labels such as JS2 and JS10 by their full numeric sequenceOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and sorting controlsWork with a free, easy-to-use office suite
QA img-9

Frequently Asked Questions

Why does Excel put JS10 before JS2?

Excel treats the labels as text and compares their characters rather than interpreting the suffix as a complete number. Extract the suffix into a numeric helper column to sort it numerically.

What if my technician initials have different lengths?

The two-character formulas will not reliably separate those labels. Separate the initials and number during import or use a pattern-based extraction before applying the sort.

How do I keep the rest of each row together when sorting?

Select the complete table, including all related columns and helper columns, before choosing Data > Sort. If Excel offers to expand the selection, choose that option.

Can I remove the helper columns after sorting?

Yes. After the sort is complete, select the helper columns and delete them if you no longer need them. Keep them if you expect to repeat the sort after adding labels.