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 Lounger -
WSMike 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
-
Microsoft vs Passwords
by
Alex5723
14 minutes ago -
Windows 11 Insider Preview build 26200.5516 released to DEV
by
joep517
3 hours, 14 minutes ago -
Windows 11 Insider Preview build 26120.3653 (24H2) released to BETA
by
joep517
3 hours, 16 minutes ago -
Two March KB5053606 updates?
by
Adam
8 hours, 20 minutes ago -
MS Edge Not Updating to v134.0.3124.95 (rel. 27-Mar-2025)
by
lmacri
4 hours, 29 minutes ago -
Intel® Graphics/Sound Driver updates for 7th-10th Gen Intel® Core™ Processor
by
Alex5723
2 hours, 55 minutes ago -
Is there a comprehensve way to tranfer ALL current Edge Settings into a new Edge
by
Tex265
14 hours, 57 minutes ago -
Transferring ALL info/settings from current Firefox to new computer Firefox
by
Tex265
16 hours, 20 minutes ago -
DOGE Wants to Replace SSA 60 Million Line COBOL Codebase in Months
by
EyesOnWindows
11 hours, 6 minutes ago -
KB5051989 Usb printer Post Ipp
by
licencesti
15 hours, 19 minutes ago -
Removing bypassnro
by
Susan Bradley
48 minutes ago -
Up to 30 seconds to show “Recent Topics”
by
PL1
19 hours, 40 minutes ago -
Sound changes after upgrade from W11 23H2
by
WStaylorpsepa
21 hours, 24 minutes ago -
Windows bug blocks BIOS updates for Lenovo ThinkPad laptops
by
Alex5723
1 day ago -
O&O Software – ‘World Backup Day’ Sale
by
unbob
20 hours, 47 minutes ago -
Still version 23H2?
by
WSbxcfilm
1 day, 1 hour ago -
Ubuntu 25.04 (Plucky Puffin) Beta released
by
Alex5723
1 day, 7 hours ago -
How to install App Store apps on an external SSD
by
Alex5723
1 day, 8 hours ago -
Where is Windows going?
by
Susan Bradley
1 hour, 8 minutes ago -
Installing Feature Update Windows 11 24H2
by
geekdom
2 days, 1 hour ago -
Windows 11 Insider Preview build 27823 released to Canary
by
joep517
2 days, 1 hour ago -
Windows 11 Hotpatch
by
Hackmuss
1 day, 9 hours ago -
System Guard service error still won’t be fixed
by
Susan Bradley
2 days, 2 hours ago -
Operation ForumTroll: APT attack with Google Chrome zero-day exploit chain
by
Alex5723
1 day, 20 hours ago -
Troy Hunt of HaveIBeenPwned Phished
by
Lars220
2 hours, 14 minutes ago -
Microsoft Windows security auditing Code 5061
by
mpw
2 days, 15 hours ago -
Can’t display images in incoming Outlook 365 emails
by
WScopwriter
1 day, 22 hours ago -
Windows 11 Insider Preview Build 26200.5510 early builds of 25H2
by
Alex5723
2 days ago -
0Patch : Micropatches released for SCF File NTLM Hash Disclosure Vulnerability
by
Alex5723
1 day, 23 hours ago -
Select multiple emails and they all open up!
by
CeeJay
3 days, 16 hours ago
Recent blog posts
- Removing bypassnro
- Where is Windows going?
- System Guard service error still won’t be fixed
- Third party add ins reminder
- MS-DEFCON 4: Mixed bag for March
- Classic and Extended Control Panel — no need to say goodbye
- Things you can do in 2025 that you couldn’t do in 2024
- Revisiting Windows 11’s File Explorer
Key Links
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.