+ Reply to Thread
Results 1 to 7 of 7

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 a follow-up to a previous post that was solved, but I need to add the ability to handle a 2nd alpha string, as in the example below. I have a list of values, represented by column A below. I'd like to help to generate formulas for rows B,C,D,E that will extract each alpha and each numeric portion of the value into separate columns, as in the image below.

    Here is the previous post:
    http://www.excelforum.com/showthread...t=#post4138955
    I'm currently using the solution from XOR LX posted 07-20-2015, 02:48 PM, but it can not handle the 2nd alpha string. Any help would be greatly appreciated.

    Note the occasional leading zeros that need to be retained.

    Capture.JPG

    Thanks,
    Trevor

  2. #2
    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 should note that the 2nd alpha string, if present at all, will be either 1 or 2 characters. Total character count could be up to 11.
    Thanks

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,572

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

    This solution uses 11 helper columns which may be hidden for aesthetic purposes. The formula that populates the helper columns, placed in F2; copied to P2 then down, is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The formulas that yield the 1st number, 1st alpha string, 2nd number and 2nd alpha string respectively are:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

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

    Try this ...

    In B2:

    =IFERROR(LOOKUP(10^10,--LEFT(A2,ROW($1:$10))),"")

    In C2:

    =MID(A2,LEN(B2)+1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&1234567890,LEN(B2)+1))-LEN(B2)-1)

    In D2:

    =IFERROR(LOOKUP(10^10,--MID(A2,LEN(B2)+LEN(C2)+1,ROW($1:$10))),"")

    In E2:

    =REPLACE(A2,1,LEN(B2)+LEN(C2)+LEN(D2),"")

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

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

    Or (without helpers), assumes data start in A2):

    First number (in B2)
    =LOOKUP(99^99,--(0&MID(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&1234567890)),ROW(INDIRECT("1:"&LEN(A2)+1)))))

    First TEXT in C2
    =LEFT(SUBSTITUTE(A2,B2,"",1),MIN(FIND({0,1,2,3,4,5,6,7,8,9},SUBSTITUTE(A2,B2,"",1)&"0123456789"))-1)

    Second number (in D2, retaining leading zeros - an ARRAY FORMULA):
    =LEFT(SUBSTITUTE(A2,B2&C2,"",1),MAX(IF(ISNUMBER(VALUE(MID(SUBSTITUTE(A2,B2&C2,"",1),ROW(INDIRECT("1:" & LEN(SUBSTITUTE(A2,B2&C2,"",1)))),1))),ROW(INDIRECT("1:" & LEN(SUBSTITUTE(A2,B2&C2,"",1)))))))

    Second Text (in E2):
    =SUBSTITUTE(SUBSTITUTE(A2,B2&C2,"",1),D2,"")

    The third one is a bit of a monster!!

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  6. #6
    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'm going with Glenn's most recent post for my particular file, although I think the others would have worked as well. Thank you all for your input.
    Last edited by Trevor K; 09-21-2016 at 07:01 PM.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

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

    Glad to have helped and thanks for the Reputation.

+ 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. Replies: 2
    Last Post: 03-17-2016, 08:55 AM
  2. Separating Alpha and Numeric Characters
    By genoa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2015, 04:57 AM
  3. Separating alpha, numeric and other characters
    By ldg in forum Excel General
    Replies: 10
    Last Post: 08-04-2015, 02:16 PM
  4. [SOLVED] Separating alpha and numeric characters, no delimiter, varying lengths
    By Trevor K in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-21-2015, 09:40 PM
  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. [SOLVED] 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