I am trying to figure out how to split a column that contains alpha numeric characters. For example, I have in Cell A1, ABC1234567,
Cell A2 has AB12345678, Cell A3 has ABCDE12345 and Cell A4 has ABC12 34 567. Is there any way of turning column A into 2 separate columns, one containing all the alpha characters and another containing all the numeric characters?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Splitting alpha numeric cells (Microsoft 97)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Splitting alpha numeric cells (Microsoft 97)
- This topic has 19 replies, 7 voices, and was last updated 23 years, 2 months ago.
AuthorTopicWSMike Chez
AskWoody LoungerDecember 3, 2001 at 5:18 pm #363677Viewing 5 reply threadsAuthorReplies-
WSWassim
AskWoody Lounger -
WSSammyB
AskWoody Lounger -
WSWassim
AskWoody LoungerDecember 3, 2001 at 9:00 pm #555792Sammy
NO one can compete with BobU on these kind of formulas. Bob is one of a kind
…
But to be honest I did have his formula as a basis to start from. Maybe something that would test if IsNumber. But then how do you split the cell after you find where to split it.This has to be two column-formula.
Wassim
-
WSJohnBF
AskWoody LoungerDecember 3, 2001 at 10:23 pm #555811You guys need to cheat! King Bob Umlas’ answer is right here (two tweaks courtesy of me). This part extracts the numbers, must be array-entered:
{=1*MID(SUBSTITUTE(A1,” “,””),MATCH(FALSE,ISERROR(1*MID(A1,ROW($1:$10),1)),0),255)}
(So who cares if I don’t understand it?)
And, assuming the source data is in Column A, and the above is in column B, extarcting the letters is easy:
=LEFT(A1,LEN(SUBSTITUTE(A1,” “,””))-LEN(B1))
-
WSSammyB
AskWoody Lounger -
WSJohnBF
AskWoody Lounger -
WSWassim
AskWoody LoungerDecember 4, 2001 at 2:07 pm #555887John
I just hope Mike is paying attention to all what we are offering.
BUT I guess you need to go back to the drawing board because your formula needs some work.
If the Number are followed by Text then (1*MID(A1,ROW($1:$10),1)) gets to be Number #Value.
But all in all, its impressive.
Wassim
-
WSJohnBF
AskWoody Lounger -
WSSammyB
AskWoody Lounger
-
-
-
-
H. Legare Coleman
AskWoody PlusDecember 3, 2001 at 9:14 pm #555795The following VBA code will split the values in Column A on Sheet1 like you want into columns B and C.
Public Sub SplitA() Dim I As Long, J As Long I = 0 With Worksheets("Sheet1").Range("A1") While .Offset(I, 0).Value "" For J = 1 To Len(.Offset(I, 0).Value) If IsNumeric(Mid(.Offset(I, 0).Value, J, 1)) Then Exit For End If Next J .Offset(I, 1).Value = Left(.Offset(I, 0), J - 1) .Offset(I, 2).Value = Right(.Offset(I, 0), Len(.Offset(I, 0)) - J + 1) I = I + 1 Wend End With End Sub
WSWassim
AskWoody LoungerWSMike Chez
AskWoody LoungerDecember 4, 2001 at 11:17 pm #555977Thank you all for all of your responses. It’s 6:10PM on 12/4. Due to other problems that came up at woork, this is the first time that I had a chance to do anything with your suggestions.
LegareColeman: I just typed your code in and I got a Run time error ’13’: Type Mismatch relating to the line containing
While.Offset(I,0).Value””. I don’t know what I did wrong or could be wrong.-
H. Legare Coleman
AskWoody Plus -
WSMike Chez
AskWoody Lounger -
H. Legare Coleman
AskWoody Plus
-
-
WSAndrew Cronnolly
AskWoody LoungerDecember 5, 2001 at 12:57 pm #556159Just anther option for you in the form of a function. The following function will return the left part of a string from th estart up to the last text character. If all your entries start with Text and then switch to numbers it should work fine.
Function ExtractText(rng As Range) Dim i As Long, strTemp As String strTemp = rng.Value For i = 1 To Len(strTemp) If Not IsNumeric(Mid(strTemp, i, 1)) Then ExtractText = Left(strTemp, i) End If Next End Function
If A1 contains ABC123,
then in B1 =ExtractText(A1) will return ABC,
and in C1 =RIGHT(A1,(LEN(A1)-LEN(B1))) will return 123.
Just one more option for you.
Andrew C
WSSammyB
AskWoody LoungerDecember 5, 2001 at 1:12 pm #556167Mike, Legare’s code works for me. When you want to use anyone’s post, select the text and copy it to Word, then select it again in Word and copy it to VBA.
Since you seem to prefer a VBA solution, here is a general-pupose function, STRIP. It strips off whatever you don’t want, letters, numbers, or punctuation. So, in your case =STRIP(A1,”Numbers”) would give “ABC”. HTH –Sam
Option Explicit Public Function STRIP(TEXT As Variant, OP As Variant) ' TEXT is any string ' OP is what to strip: NUMBERS, LETTERS, or PUNCTUATION ' (only the first letter is needed: N, L, or P) Dim i As Integer Dim letter As String Dim s As String s = "" For i = 1 To Len(TEXT) letter = Mid(TEXT, i, 1) If IsNumeric(letter) Then If Left(UCase(OP), 1) = "L" Then s = s & letter End If Else If Left(UCase(OP), 1) = "N" Then s = s & letter End If End If If Left(UCase(OP), 1) = "P" Then If IsNumeric(letter) Or _ (Asc(UCase(letter)) >= Asc("A") And Asc(UCase(letter)) <= Asc("Z")) Then s = s & letter End If End If Next i STRIP = s End Function
-
WSMike Chez
AskWoody Lounger
WSAladin Akyurek
AskWoody LoungerJanuary 13, 2002 at 9:51 am #563461Given the structure of your examples,
{“ABC1234567”;
“AB12345678”;
“ABC12 34 567″}which, say, A1:A3 houses,
in B1 enter: =SUBSTITUTE(A1,RIGHT(A1,SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{” “,0,1,2,3,4,5,6,7,8,9},””))))),””)
in C1 enter: =SUBSTITUTE(A1,B1,””) or, depending on what you’d prefer, =SUBSTITUTE(SUBSTITUTE(A1,B1,””),” “,””)+0
Select B1:C1 and copy down.
Viewing 5 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Photos from iPhone to Win 10 duplicating/reformatting to .mov
by
J9438
48 minutes ago -
Thunderbird in trouble. Here comes Thundermail
by
Alex5723
2 hours, 57 minutes ago -
Get back ” Open With” in context menus
by
CWBillow
3 hours, 21 minutes ago -
Many AMD Ryzen 9800X3D on ASRock have died
by
Alex5723
7 hours, 8 minutes ago -
simple general stupid question
by
WSaltamirano
1 hour, 8 minutes ago -
Automatic Toggle code for pages and bookmarks for Table of Content (Awaiting moderation)
by
switchtolinux
11 hours, 31 minutes ago -
April 2025 Office non-Security updates
by
PKCano
3 hours, 15 minutes ago -
Microsoft wants to hear from you
by
Will Fastie
19 hours, 23 minutes ago -
Windows 11 Insider Preview Build 22635.5160 (23H2) released to BETA
by
joep517
21 hours, 43 minutes ago -
Europe Seeks Alternatives to U.S. Cloud Providers
by
Alex5723
1 day, 3 hours ago -
Test post
by
Susan Bradley
1 day, 5 hours ago -
Used Systems to delete Temp files Gone WRONG what does this mean?
by
Deo
1 day, 7 hours ago -
SSD shuts down on its own
by
CWBillow
22 hours, 33 minutes ago -
OneDrive File Sharing Changes
by
David Clark
1 day, 15 hours ago -
OneDrive File Sharing Changes
by
David Clark
1 day, 17 hours ago -
Win 10 Pro 22H2 to Win 11 Pro 23H2 Conversion Guide
by
doneager
17 hours, 20 minutes ago -
Today is world backup day
by
Alex5723
1 day, 8 hours ago -
Windows .exe on Mint
by
Slowpoke47
1 day, 18 hours ago -
Reviewing your licensing options
by
Susan Bradley
1 day, 4 hours ago -
Apple has been analyzing your photos since September 2024
by
B. Livingston
14 hours, 7 minutes ago -
What Windows 11 24H2 offers beyond bugs
by
Lance Whitney
9 hours, 58 minutes ago -
Making sense of Settings in Windows 11
by
Simon Bisson
11 hours, 17 minutes ago -
Windows 11 pro fails to log in after upgrading Win 10 pro to Win 11 pro 24h2
by
ben_sitaud
1 day, 15 hours ago -
23H2 / 24H2 / Local v. Microsoft Account.
by
CWBillow
1 day, 12 hours ago -
YouTube Ad Blocker Blocker
by
bbearren
1 day, 13 hours ago -
Obscure historical facts about Windows
by
Cybertooth
1 day, 14 hours ago -
Microsoft Backup
by
Linda2019
1 day, 6 hours ago -
What is the best notepad++ version for W7?
by
Picky
1 day, 13 hours ago -
What are right steps to move MS 365 Office+OneDrive files from PC to iMac?
by
glnz
2 days, 23 hours ago -
How to move existing MS 365 Office with OneDrive files from PC to new iMac
by
glnz
2 days, 23 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.