Split mixed string in excel.

I have an intractable problem. There is this huge, long column at work which contains mixed strings with the following format:

ue6584
th45
hur4562243
So it is very irregular, the only regularity is that it starts with letters and ends with numbers. I need to split the strings in each cell so that:

ue6584             —> ue 6584
th45                 —> th 45
hur4562243     —> hur 4562243
So the cell splits into two columns, one column containing the letters only, the other the numbers only. So far, I am thinking this is impossible to do in excel.

Can anyone help please?

Thank you in advance, Dritan
Dritan NikollaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Place this code in a code module like Module1.

Function TwoColumns(r As Range, intPart As Integer) As String
Dim intChar As Integer

If intPart = 1 Then
    For intChar = 1 To Len(r)
        If IsNumeric(Mid$(r, intChar, 1)) Then
            Exit Function
        Else
            TwoColumns = TwoColumns & Mid$(r, intChar, 1)
        End If
    Next
Else
    For intChar = 1 To Len(r)
        If IsNumeric(Mid$(r, intChar, 1)) Then
            TwoColumns = TwoColumns & Mid$(r, intChar, 1)
        End If
    Next
End If
End Function

Open in new window

Assuming the data is in column "A" and you want the results in "B" and "C" then
Usage for "B":
= TwoColumns(A1,1)
Usage for "C":
= TwoColumns(A1,2)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
The "2" in the formula for column "C" could actually be any number other than 1.
0
Ejgil HedegaardCommented:
With value in A1.
Text
=LEFT(A1,SEARCH(RIGHT(A1,LEN(A1)-MIN(FIND(0,SUBSTITUTE(A1,{1,2,3,4,5,6,7,8,9},0)&0))+1),A1)-1)

Open in new window

Number, array formula, insert with Ctrl+Shift+Enter
=NPV(-0.9,IFERROR(MID(A1,1+LEN(A1)-ROW(INDIRECT("1:"&LEN(A1))),1)/10,""))

Open in new window

See file
Dritan-split-text-and-numbers.xlsx
1
Bill PrewCommented:
You can use the same technique demonstrated here:



»bp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.