Splitting string into letters and numbers

G

Guest

Hey there all,

I've got a few strings that need sorting. Some examples could be:

ABC123
ABFYE6
BHYF1478

I need to separate the letters and the numbers into two different columns.

How can this be done? Is there a way to identify whether a character is a
number, letter or symbol or something?

Thanks very much,
Pete
 
J

Jason Morin

With a formula you can identify the position of the 1st
number with:

=MIN(IF(ISNUMBER(1*MID(A1,ROW(INDIRECT("1:"&LEN
(A1))),1)),ROW(INDIRECT("1:"&LEN(A1)))))

Array-entered. From there you can use MID, LEFT, or RIGHT
to split it, or even insert a delimiter like "|" and
split it from there:

=REPLACE(A1,MIN(IF(ISNUMBER(1*MID(A1,ROW(INDIRECT("1:"&LEN
(A1))),1)),ROW(INDIRECT("1:"&LEN(A1))))),,"|")

Also array-entered.

HTH
Jason
Atlanta, GA
 
G

Guest

Thanks Jason, that was a big help!

Jason Morin said:
With a formula you can identify the position of the 1st
number with:

=MIN(IF(ISNUMBER(1*MID(A1,ROW(INDIRECT("1:"&LEN
(A1))),1)),ROW(INDIRECT("1:"&LEN(A1)))))

Array-entered. From there you can use MID, LEFT, or RIGHT
to split it, or even insert a delimiter like "|" and
split it from there:

=REPLACE(A1,MIN(IF(ISNUMBER(1*MID(A1,ROW(INDIRECT("1:"&LEN
(A1))),1)),ROW(INDIRECT("1:"&LEN(A1))))),,"|")

Also array-entered.

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top