+ Reply to Thread
Results 1 to 18 of 18

Extracting specific part of the text string to another column

  1. #1
    Registered User
    Join Date
    04-30-2011
    Location
    Indian, TN
    MS-Off Ver
    Excel 2007
    Posts
    37

    Extracting specific part of the text string to another column

    Hi Excel Experts,

    Please advise me a formula that will help me bring the desired result in the column B from the available data in Column A as shown below:

    Data in A column:
    A1 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS A 02/19/98 701-483-3456 ABC
    A2 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS B 02/19/98 701-483-3456 ABCD
    A3 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS TC 02/19/98 701-483-3456 ABCDE
    A4 = 3AB LT00022788 TH0000243428 JACK,LUC A 02/19/98 701-483-3456 701-483-3456 Andy,Pat
    A5 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS B 02/19/98 701-483-3456 ABCDEF
    A6 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS TC 02/19/98 701-483-3456 701-483-3456 ABCDEFG
    A7 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS C 02/19/98 ABCDEFGH
    A8 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS IF 02/19/98 Andy,Patricia J ABCDEFGHI
    A9 = 3AB LT00022788 TH0000243428 STEINER,CORBAN PAUL G ABC2
    A10 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS B 02/19/98 701-483-3456 ABCD2

    Desired Result in B column
    B1 = ABC
    B2 = ABCD
    B3 = ABCDE
    B4 =
    B5 = ABCDEF
    B6 = ABCDEFG
    B7 = ABCDEFGH
    B8 = ABCDEFGHI
    B9 = ABC2
    B10 = ABCD2

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    08-29-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Extracting specific part of the text string to another column

    Hi Sanju,

    Please Login or Register  to view this content.
    Try this formula if this could help you

    Thanks
    Dinesh
    Please click * below my name if this helped ypu

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Extracting specific part of the text string to another column

    Hi ssanju,

    You have ignored A4 because it had comma (,) at the end or there is some other reason ?

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Extracting specific part of the text string to another column

    dinesh, I think ABC is just example so you can not search it.

    Here, use this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    As dilipandey noted, if there is a comma in last word does it need to return blank? If so, use:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Extracting specific part of the text string to another column

    Try this in B1:
    =IFERROR(RIGHT(A1,LEN(A1)-FIND("~AB",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))),"")
    Drag down

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Extracting specific part of the text string to another column

    Hi Dinesh,
    I guess this is not real data with ABCD...
    I think the rule here is:
    * Find the last blank space " " (or the last number character,...)
    * Check all charaters after whether is in upper case or not
    So below may works, if finding the last blank space:
    Please Login or Register  to view this content.
    Confirmed with Ctrl-Shift-Enter
    Quang PT

  7. #7
    Registered User
    Join Date
    04-30-2011
    Location
    Indian, TN
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Extracting specific part of the text string to another column

    I am very sorry, my data mislead with the last capital alpha characters ABC being similar throughout. Actually this can be any random alphanumeric like USA, BSA2 etc.,

    I think the only catch would be that these characters in the end of the string are all in caps and at times followed by a number. Also on few instances there is no capital letters in the end wherein the resultant needs to be blank.

    Please advise and so sorry again. I will be more detailed in future. Thanks.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Extracting specific part of the text string to another column

    So the #6 works?

  9. #9
    Registered User
    Join Date
    04-30-2011
    Location
    Indian, TN
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Extracting specific part of the text string to another column

    I tried but the formula provided in #6 didn't work, it shows #N/A. Please advise.

  10. #10
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Extracting specific part of the text string to another column

    You can try this one :

    =IF(ISNUMBER(FIND(UPPER(TRIM(RIGHT(SUBSTITUTE(A4," ",REPT(" ",255)),255))),TRIM(RIGHT(SUBSTITUTE(A4," ",REPT(" ",255)),255)))),TRIM(RIGHT(SUBSTITUTE(A4," ",REPT(" ",255)),255)),"")

    I used zbors formula because it was SO much shorter than mine

    Hope this helps

    Edit-
    Copied from wrong cell..sorry A4's should read A1
    Last edited by dredwolf; 01-20-2013 at 06:02 AM.

  11. #11
    Registered User
    Join Date
    04-30-2011
    Location
    Indian, TN
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Extracting specific part of the text string to another column

    The formula provided in #10 worked. Thank you so much for all your support and everyone's time.

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Extracting specific part of the text string to another column

    Quote Originally Posted by ssanjju View Post
    I tried but the formula provided in #6 didn't work, it shows #N/A. Please advise.
    Now #10 works, but anyway, #6 might return error because you hit enter. And you must comfirm formula with ctrl+shift+enter

  13. #13
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Extracting specific part of the text string to another column

    You are welcome

  14. #14
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Extracting specific part of the text string to another column

    But that would return blank for
    Please Login or Register  to view this content.
    and according to post #1 should return ABC2.

    Here, try this. It check last characeter (must not be Uppercase if you want blank).

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    04-30-2011
    Location
    Indian, TN
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Extracting specific part of the text string to another column

    I am very sorry, there is a glitch. While applying the formula to the huge data with me, I realized that when the string just stops with the phone # such as given below.

    A1 = 3AB LT00022788 TH0000243428 JACKSON,LUCAS B 02/19/98 701-483-3456

    the result is the phone# whereas desired is a blank if there is no Capital alphanumeric value in the end of the string. Please help.

  16. #16
    Registered User
    Join Date
    04-30-2011
    Location
    Indian, TN
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Extracting specific part of the text string to another column

    Also the end part of the string can be all capital alpha characters or can be capital alphanumeric value. But if in case these are not available as provided by me above the result should be a blank instead of the phone#. Please provide your as usual support. Thanks in advance.

  17. #17
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Extracting specific part of the text string to another column

    Try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Comfirmed with ctrl+shift+enter and not just enter

  18. #18
    Registered User
    Join Date
    04-30-2011
    Location
    Indian, TN
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Extracting specific part of the text string to another column

    The formula in #17 worked like a charm! thank you so much Zbor for all your patience and time.

+ 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