+ Reply to Thread
Results 1 to 11 of 11

Separating alpha and numeric characters, no delimiter, varying lengths

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    Rawlins, WY
    MS-Off Ver
    2013
    Posts
    8

    Separating alpha and numeric characters, no delimiter, varying lengths

    This is my first post here. Any help would greatly appreciated. I am trying to separate alpha characters, followed by numeric characters, followed by more alpha characters in 3 separate columns. There are no delimiters, and each set of characters can be different lengths. The alpha characters are always capitalized. I would like to do this with formulas.
    Example:
    A1=1C105
    A2=9MP028
    A3=25MJR338
    A4=8PV4545

    Thank you in advance for your help.
    Trevor

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    Would results look like this?

    1c105 1 c 105
    9mp028 9 mp 028
    25mjr338 25 mjr 338
    8pv4545 8 pv 4545
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    04-15-2014
    Location
    Rawlins, WY
    MS-Off Ver
    2013
    Posts
    8

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    Yes, except the alpha characters would still be capital letters.

  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: Separating alpha and numeric characters, no delimiter, varying lengths

    Using your posted examples and assuming no text will be longer than 10 characters

    These formulas, copied down, return the individual segments:

    Left digits
    Please Login or Register  to view this content.
    Right digits
    Please Login or Register  to view this content.
    Middle text
    Please Login or Register  to view this content.
    These are the results:
    Data Range
    A
    B
    C
    D
    1
    1C105
    1
    C
    105
    2
    9MP028
    9
    MP
    028
    3
    25MJR338
    25
    MJR
    338
    4
    8PV4545
    8
    PV
    4545

    Is that something you can work with?
    Last edited by Ron Coderre; 07-20-2015 at 03:57 PM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    04-15-2014
    Location
    Rawlins, WY
    MS-Off Ver
    2013
    Posts
    8

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    Worked like a charm. This was a huge help to me and I really appreciate it.
    Thank you

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

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    Glad you got something you can use!

    If that resolves your issue, please take a moment to mark this thread as SOLVED (from the Thread Tools menu)

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    Quote Originally Posted by Ron Coderre View Post

    Left digits
    Please Login or Register  to view this content.
    Right digits
    Please Login or Register  to view this content.
    Middle text
    Please Login or Register  to view this content.
    But if you make the minutest of changes to the first example given by the OP, i.e. if A1 contains 1E105 instead of 1C105 then all these fail.

    And that's just one example. They also fail (given the appropriate date/language settings, that is) if A1 contains e.g. 1MAR105, etc., etc.

    In B1:

    =-LOOKUP(1,-(LEFT(A1,{1,2,3,4,5,6,7,8,9,10})&"**0"))

    In D1:

    =-LOOKUP(1,-(RIGHT(A1,{1,2,3,4,5,6,7,8,9,10})&"**0"))

    should be more rigorous (and a touch simpler).

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    @Ron Coderre

    Apologies. I see the need for your result_vector set-up now to deal with leading zeroes.

    In that case:

    =LEFT(A1,LOOKUP(1,-(LEFT(A1,{1,2,3,4,5,6,7,8,9,10})&"**0"),{1,2,3,4,5,6,7,8,9,10}))

    and:

    =RIGHT(A1,LOOKUP(1,-(RIGHT(A1,{1,2,3,4,5,6,7,8,9,10})&"**0"),{1,2,3,4,5,6,7,8,9,10}))

    Nice idea by the way.

    Regards

  9. #9
    Registered User
    Join Date
    04-15-2014
    Location
    Rawlins, WY
    MS-Off Ver
    2013
    Posts
    8

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    Thanks for the additional help XOR LX. I will mark this as solved.

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

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    I know this has been marked as solved...but, I just thought the solution could be simpler than I was making it.

    Consequently, I came up with these formulas:

    Please Login or Register  to view this content.
    There might be shorter solutions, but I suspect they might be too arcane to readily understand.

  11. #11
    Registered User
    Join Date
    04-15-2014
    Location
    Rawlins, WY
    MS-Off Ver
    2013
    Posts
    8

    Re: Separating alpha and numeric characters, no delimiter, varying lengths

    I have not yet finished my spreadsheet and I will check out your latest solution. Thanks again for your help with this. You probably saved me several hours.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Separating alpha, numeric and other characters
    By ldg in forum Excel General
    Replies: 10
    Last Post: 08-04-2015, 02:16 PM
  2. Format column with both alpha and numeric characters
    By wsykes41770 in forum Excel General
    Replies: 3
    Last Post: 10-01-2014, 11:15 AM
  3. Convert Alpha characters back to numeric
    By CNE5x in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2013, 11:46 PM
  4. Separate Alpha and numeric characters
    By sivdin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-09-2013, 02:50 AM
  5. separating numeric and alpha cell contents
    By lintcoop in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-02-2013, 07:45 PM
  6. Replies: 3
    Last Post: 02-21-2012, 09:34 AM
  7. Can you ID a cell that has both Alpha AND Numeric characters?
    By Phil in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-18-2006, 04:35 PM

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