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.


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
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.
    Lorne Rowe · 2 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 · 3 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 · 3 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 · 1 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 · 2 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 · 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?

    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