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 split / separate alphanumeric strings into two columns in Excel?

To separate the alphanumeric strings into two separated columns, one contains numbers, and another contains alphabetical characters, may help you handle the data as quickly as you need, this article, I will talk about some useful methods for you to split the alphanumeric strings into two individual columns.

Split / Separate alphanumeric strings into two columns with User Defined Function

Split / Separate alphanumeric strings into two columns with Kutools for Excel


Split / Separate text strings into individual text and number columns:

Kutools for Excel’s Split Cells feature is a powerful tool, it can help you to split cell values into multiple columns or rows, it can help you to slit alphanumeric strings into separated text and numbers columns, etc…

doc-separate-text-number-18

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!



For example, I have a range of alphanumeric strings needed to be separated into two columns as following screenshot shown:

doc split alphanumeric 1

Here, I can create a User Defined Function to solve this task, please do as follows:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: separate alphanumeric strings into two columns:

Function RetNum(Str As String)
'updateby Extendoffice 20151214
    Dim xRegEx As Object
    Set xRegEx = CreateObject("vbscript.regexp")
    xRegEx.Global = True
    xRegEx.Pattern = "[^\d]+"
    RetNum = xRegEx.Replace(Str, "")
    Set xRegEx = Nothing
End Function
Function RetNonNum(Str As String)
    Dim xRegEx As Object
    Set xRegEx = CreateObject("vbscript.regexp")
    xRegEx.Global = True
    xRegEx.Pattern = "[\d]+"
    RetNonNum = xRegEx.Replace(Str, "")
    Set xRegEx = Nothing
End Function

3. Then save and close this code, go back to the worksheet, and enter this formula: =retnonnum(A2) into a blank cell, then drag the fill handle down to the cells to apply this formula, all the alphabetical characters have been extracted from the reference column at once, see screenshot:

doc split alphanumeric 2

4. Go on entering this formula: =retnum(A2) into another blank cell, and drag the fill handle down to the cells to contain this formula, then all numbers have been returned as following screenshot shown:

doc split alphanumeric 3


If you have Kutools for Excel, with its Split Cells utility, you can quickly split the alphanumeric strings into separated columns.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days

After installing Kutools for Excel, please do as follows:

1. Select the alphanumeric strings that you want to separate.

2. Click Kutools > Text > Split Cells, see screenshot:

doc split alphanumeric 4

3. In the Split Cells dialog box, select Split to Columns under the Type section, and then choose Text and number under the Split by section, see screenshot:

doc split alphanumeric 5

4. Then click Ok button, and a prompt box will pop out to remind you select a cell where you need to locate the separated result, see screenshot:

doc split alphanumeric 6

5. And then click OK, the alphabetical characters and the numbers are separated into two columns at once, see screenshot:

doc split alphanumeric 7

Download and free trial Kutools for Excel Now !


Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, 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 80% 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.

Be the first to comment.