+ Reply to Thread
Results 1 to 11 of 11

Any way possible to parse this text??

  1. #1
    Registered User
    Join Date
    01-13-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    13

    Any way possible to parse this text??

    We received a large Excel file that contains text in one field that's useless as entered. What we've been trying to do, without much success(!), is create formula(s) to break the text down into separate fields.

    For example, in the attached "sample.xls" file, Column A has the raw data. We need to break Column A into three separate fields as shown in Columns B, C, and D. For illustration purposes I've just typed the broken down text in the first two rows to show how we'd like it to appear.

    Given there's no hard & fast convention for how the data was entered initially (other than the first "/" between the names, even coming close and having to tweak manually would be a huge help.

    Any suggestions would be greatly appreciated.

    Jill
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Any way possible to parse this text??

    In B2
    =LEFT(A2,FIND("/",A2)-1)

    In C2
    =LEFT(SUBSTITUTE(A2,E2&"/",""),FIND("(",SUBSTITUTE(A2,E2&"/",""))-1)

    In D2
    =RIGHT(A2,LEN(A2)-FIND("(",A2)+1)

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Any way possible to parse this text??

    In B2 Cell

    =IFERROR(LEFT(A2,FIND("/",A2)-1),"")

    In C2 Cell

    =IFERROR(MID(A2,FIND("/",A2)+1,(IFERROR(FIND("(",A2),LEN(A2)+1)-FIND("/",A2))-1),"")

    In D2 Cell

    =IFERROR(MID(A2,FIND("(",A2),5^5),"")

    Drag all the formula's down...


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Any way possible to parse this text??

    Slightly different approach....
    1st part...=LEFT(A2,FIND("/",A2,1)-1)
    middle part...=IF(ISERROR(FIND("(",A2,1)),MID(A2,FIND("/",A2,1)+1,99),MID(A2,FIND("/",A2,1)+1,FIND("(",A2,1)-FIND("/",A2,1)-2))
    last part...=IF(ISERROR(FIND("(",A2,1)),"",MID(A2,FIND("(",A2,1),99))

    I notice that the 2nd entry does not have a 3rd part, so my 2nd and 3rd formulas adjust to cater for that
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    01-13-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Any way possible to parse this text??

    WOW-- 3 responses just minutes after my initial post!
    Thanks very much to all who replied.

    Your formulas worked great Ace_XL. Where there was no paren text at the end of A3 that was noted but that's not an issue at all.

    Quote Originally Posted by Ace_XL View Post
    In B2
    =LEFT(A2,FIND("/",A2)-1)

    In C2
    =LEFT(SUBSTITUTE(A2,E2&"/",""),FIND("(",SUBSTITUTE(A2,E2&"/",""))-1)

    In D2
    =RIGHT(A2,LEN(A2)-FIND("(",A2)+1)

    Copy down

  6. #6
    Registered User
    Join Date
    01-13-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Any way possible to parse this text??

    Great-- works perfectly! Thank you SO much. Perhaps I'll tell the others that I was up all night working on this.

    Nah, got to give credit where credit's due. I wasn't even close.

    Quote Originally Posted by :) Sixthsense :) View Post
    In B2 Cell

    =IFERROR(LEFT(A2,FIND("/",A2)-1),"")

    In C2 Cell

    =IFERROR(MID(A2,FIND("/",A2)+1,(IFERROR(FIND("(",A2),LEN(A2)+1)-FIND("/",A2))-1),"")

    In D2 Cell

    =IFERROR(MID(A2,FIND("(",A2),5^5),"")

    Drag all the formula's down...

  7. #7
    Registered User
    Join Date
    01-13-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Any way possible to parse this text??

    Thanks much FDibbins. However, unless I messed it up somehow, the "last part' produced TRUE or FALSE rather than the paren text. I see you were allowing for a field that didn't have that text at the end, but somehow I couldn't get it to work. (?)


    Quote Originally Posted by FDibbins View Post
    Slightly different approach....
    1st part...=LEFT(A2,FIND("/",A2,1)-1)
    middle part...=IF(ISERROR(FIND("(",A2,1)),MID(A2,FIND("/",A2,1)+1,99),MID(A2,FIND("/",A2,1)+1,FIND("(",A2,1)-FIND("/",A2,1)-2))
    last part...=IF(ISERROR(FIND("(",A2,1)),"",MID(A2,FIND("(",A2,1),99))

    I notice that the 2nd entry does not have a 3rd part, so my 2nd and 3rd formulas adjust to cater for that

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Any way possible to parse this text??

    take a look at the attached
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-13-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Any way possible to parse this text??

    Got it-- works GREAT! Many thanks.

    Quote Originally Posted by FDibbins View Post
    take a look at the attached

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Any way possible to parse this text??

    Happy to help and thanks for the feedback

    For future reference, if your question has been answered, please take a moment to mark the thread as "solved" by using the THREAD TOOLS towards the top of the screen- it helps keep things neat and tidy lol. I will do it for you this time L(

  11. #11
    Registered User
    Join Date
    01-13-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Any way possible to parse this text??

    Ah, "Thread Tools". I did want to mark as solved but I was looking for that option in the message box itself. Didn't notice that menu up there. Thanks again.

    Quote Originally Posted by FDibbins View Post
    Happy to help and thanks for the feedback

    For future reference, if your question has been answered, please take a moment to mark the thread as "solved" by using the THREAD TOOLS towards the top of the screen- it helps keep things neat and tidy lol. I will do it for you this time L(

+ 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. [SOLVED] Need to parse text from a field where the placement of the text may change.
    By kaknoche in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-23-2013, 03:36 PM
  2. Macro to Parse Text - Import text to Excel from Multiple Text Files & Folders
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2012, 01:05 AM
  3. Parse text for numeric
    By AlanF51MS in forum Excel General
    Replies: 2
    Last Post: 09-05-2012, 07:40 PM
  4. Parse Text Separated by ; to next Row
    By prkhan56 in forum Excel General
    Replies: 3
    Last Post: 12-24-2011, 06:14 AM
  5. Parse Text file
    By noodle48 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2011, 12:14 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