Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to sort alphanumeric data in Excel?

Original data   Normally sort result   your wanted sort result
doc sort alphanumeric 1  2 doc sort alphanumeric 2  2 doc sort alphanumeric 3

If you have a list of data which are mixed with both numbers and text strings, when you sort this column data normally in Excel, all the pure numbers are sorted on top and the mixed text strings at bottom. But, your needed result like the last screenshot shown. This article will provide a useful method that you can use to sort alphanumeric data in Excel so that you can achieve the results you want.

Sort alphanumeric data with formula helper column


arrow blue right bubble Sort alphanumeric data with formula helper column


In Excel, you can create a formula helper column, and then sort the data by this new column, please do as following steps:

1. Enter this formula =TEXT(A2, "###") into a blank cell besides your data, B2, for instance, see screenshot:

doc sort alphanumeric 4

2. Then drag the fill handle down to the cells that you want to apply this formula, see screenshot:

doc sort alphanumeric 5

3. And then sort the data by this new column, select the helper column you created, then click Data > Sort, and in the popped out prompt box, select Expand the selection, see screenshots:

doc sort alphanumeric 6  2 doc sort alphanumeric 7

4. And click Sort button to open the Sort dialog, under Column section, choose Helper column name that you want to sort by, and use Values under Sort On section, and then select the sort order as you want, see screenshot:

doc sort alphanumeric 8

5. And then click OK, in the popped out Sort Warning dialog, please select Sort numbers and numbers stored as text separately, see screenshot:

doc sort alphanumeric 9

6. Then click OK button, you can see, the data has been sorted to your need.

doc sort alphanumeric 10

7. At last, you can delete the contents of the helper column as you need.


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Patrick · 3 months ago
    Hi, I have a similar sorting requirement, but with a unique problem ....
    I have a range of Stock data which I need to sort in Category order.
    The Range includes prices and one column has formulas.
    The Category numbers range from 1 1a 1b etc to 32e.
    I have continuously tried using a helper column with the formula =TEXT(K3,"###") - with K3 being the first Row in the Category column.
    I select the helper column (N) and click Data - Sort - Expand the selection, but get no further as the "expansion" always selects from Row 40 - even if I select just a few rows in the helper column.
    Why is this, and how can I sort my data correctly ?
    Looking forward to a solution ....
    Thanks.
    Patrick.
  • To post as a guest, your comment is unpublished.
    Lorne Rowe · 9 months ago
    Thanks for the tip on using a "helper column", but here's my question:

    Is there a way to get the "related " columns to "tag along" with the sort precipitated by the helper column?

    For example, column A contains a mixed-string product code that I can now sort into sequence using the "helper column" technique but, attached to that same product code are product descriptions, dimensions and other characteristics (some of which are also mixed-string in nature) in several other columns, and I need those to follow the "helper column" sort.

    Any suggestions?

    Much appreciated!

    Lorne
  • To post as a guest, your comment is unpublished.
    val · 10 months ago
    I only see 1 method. Top of the article mentions that we will see 2 methods.
    • To post as a guest, your comment is unpublished.
      skyyang · 9 months ago
      Hello, val,
      Thank you for your comment, it is my mistake, I have deleted the second method from this article, and now, I have updated the article.

      Thank you once more!
  • To post as a guest, your comment is unpublished.
    Vinod Saini · 2 years ago
    Trying to sort Alphanumeric with text. It is a fairly large list but below is an example. I can't strip the off the letter in a different column and sort by that because I have matching numbers that should come before them. I also can't really add a column to sort by and then hide that column - or delete it because I am constantly sorting the data. Any ideas?
    Will there be some formula?

    My current list: ---- What I want it to look like:
    1 ---- 1
    2 ---- 2
    3 ---- 3
    4 ---- 4
    A1 ---- A1
    A10 ---- A2
    A100 ---- A3
    A2 ---- A4
    A20 ---- A5
    A200 ---- A6
    A3 ---- A7
    A4 ---- A8
    A5 ---- A9
    A6 ---- A10
    A60 ---- A20
    A7 ---- A60
    A8 ---- A100
    A9 ---- A200
    • To post as a guest, your comment is unpublished.
      VBA Dave · 1 years ago
      The easiest way I can think is to split the column into the Alpha part ("A") and the numeric part ("1") and then sort first by alpha then by numeric.
      Your original 1,2,3,4 would need to stay in the alpha column to sort properly .

      N.B. this might be a bit more difficult to achieve when the alpha part (the "A") is not a consistent length in your data. But definitely still possible.
  • To post as a guest, your comment is unpublished.
    Turfa · 3 years ago
    I am running in the same problem. I have 1200 part numbers that I need to sort the way it's shown above but excel will put V15 after V1 if V14 is absent. I need V14 to appear after V9 or V8, where ever the part number ends.
  • To post as a guest, your comment is unpublished.
    TC · 3 years ago
    Trying to sort Alphanumeric with text. It is a fairly large list but below is an example. I can't strip the off the letter in a different column and sort by that because I have matching numbers that should come before them. I also can't really add a column to sort by and then hide that column - or delete it because I am constantly sorting the data. Any ideas?

    My current list: ---- What I want it to look like:
    1 ---- 1
    2 ---- 2
    3 ---- 3
    4 ---- 4
    A1 ---- A1
    A10 ---- A2
    A100 ---- A3
    A2 ---- A4
    A20 ---- A5
    A200 ---- A6
    A3 ---- A7
    A4 ---- A8
    A5 ---- A9
    A6 ---- A10
    A60 ---- A20
    A7 ---- A60
    A8 ---- A100
    A9 ---- A200
  • To post as a guest, your comment is unpublished.
    Kayla · 4 years ago
    When I do this, the column sorts by individual character and I don't get the right order. For instance, if I have the following data:

    A1: 1
    A2: 2
    A3: 1a1
    A4: 12
    A5: 1a2

    I want them to be sorted like this:

    A1: 1
    A2: 1a1
    A3: 1a2
    A4: 2
    A5: 12

    Just sorting the column normally I end up with this:

    A1: 1
    A2: 2
    A3: 12
    A4: 1a1
    A5: 1a2

    Where the numbers are sorted correctly and then the alphanumeric values are sorted correctly, but the two are not sorted together.

    When I use the method in the article, I end up with this:

    A1: 1
    A2: 12
    A3: 1a1
    A4: 1a2
    A5: 2

    Where the numeric and alphanumeric data are sorted together but incorrectly (12 should come after 2). Why is this happening?