+ Reply to Thread
Results 1 to 7 of 7

Parsing Letters and Numbers (And Letters)

  1. #1
    Registered User
    Join Date
    03-04-2011
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    22

    Parsing Letters and Numbers (And Letters)

    Hi,

    I have a column with information like this:

    SEANHUFFINGTON1968CANADA
    ALEXAVALLANCE717ENGLAND
    EDWARDBERTRAM9113CANADA
    MICHAELSWAIN4683USA

    I wanted to know if there is a way to parse out everything that comes before the numbers and everything that comes after them. So, in other words, from this one column, I will have three separate columns indicating names, number, and country. Thank you so much for the help!

    - Joan

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Parsing Letters and Numbers (And Letters)

    With this list in A1:A4
    SEANHUFFINGTON1968CANADA
    ALEXAVALLANCE717ENGLAND
    EDWARDBERTRAM9113CANADA
    MICHAELSWAIN4683USA

    As long as the structure is ALWAYS: textnumberstext
    this regular formula begins the list of text prior to numbers in those cells
    Please Login or Register  to view this content.
    and this regular formula begins the list of text after the numbers in those cells
    Please Login or Register  to view this content.
    In the above example, these are the returned values:
    Please Login or Register  to view this content.
    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Parsing Letters and Numbers (And Letters)

    Assuming starting in A1,

    in B1:

    =LEFT(A1,MIN(FIND(0,SUBSTITUTE(A1,{1,2,3,4,5,6,7,8,9},0)&0))-1)

    in C1:

    =LOOKUP(9.999999999E+307,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW($1:$30))))

    in D1:

    =SUBSTITUTE(A1,B1&C1,"")

    each copied down

    Note: if you don't want the number column, then in C1:

    =SUBSTITUTE(A1,B1&LOOKUP(9.999999999E+307,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0 123456789")),ROW($1:$30)))),"")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Parsing Letters and Numbers (And Letters)

    Perhaps a blend of our approaches?:

    Your name formula (better than the formula I posted)
    Please Login or Register  to view this content.
    and the location formula I posted:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Parsing Letters and Numbers (And Letters)

    Good idea

  6. #6
    Registered User
    Join Date
    03-04-2011
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Parsing Letters and Numbers (And Letters)

    EDIT:

    Thank you so much, gentlemen. You really made my day!
    Last edited by jontran718; 01-12-2012 at 12:55 PM.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Parsing Letters and Numbers (And Letters)

    See my first Post... #3

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1