+ Reply to Thread
Results 1 to 13 of 13

Extracting all text from parentheses (including parentheses)

  1. #1
    Registered User
    Join Date
    02-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Extracting all text from parentheses (including parentheses)

    Hi guys,

    I have a large number of rows of cells with text that includes part numbers in parentheses. For example:

    Fitted: 2xPST TYPE 3 2770(RW44-00090A),1xFUSER - 2770(RW96-03800C)

    I need to extract the part numbers from these parentheses and separate them by a comma so it would look like this:

    (RW44-00090A), (RW96-03800C)

    Any ideas how i can acheive this with a formula?

    Thanks in advance!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extracting all text from parentheses (including parentheses)

    how many part numbers is it always 2?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    02-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Extracting all text from parentheses (including parentheses)

    No, it can be anything from 1-5 part numbers...

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extracting all text from parentheses (including parentheses)

    that1 awkward to do in onw cell with one formula! youd be better of using 5 seperate cells then joining them or maybe a vba solution

  5. #5
    Registered User
    Join Date
    02-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Extracting all text from parentheses (including parentheses)

    Do you know a formula that would work if i used it 5 times? Presumably after that i could just use =concatenate to join them up?

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extracting all text from parentheses (including parentheses)

    yep here you go
    Attached Files Attached Files
    Last edited by martindwilson; 05-10-2013 at 06:52 AM.

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Extracting all text from parentheses (including parentheses)

    Untested, but I suspect VBA would be something like this:

    Actually can that, was thinking a bit too simply

  8. #8
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Extracting all text from parentheses (including parentheses)

    if only 2 number to split try this
    =LEFT(MID(A1,FIND("(",A1),LEN(A1)),FIND(",",MID(A1,FIND("(",A1),LEN(A1))))&MID(MID(A1,FIND("(",A1),LEN(A1)),FIND("(",MID(A1,FIND("(",A1),LEN(A1)),2),LEN(A1))

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extracting all text from parentheses (including parentheses)

    it think you have not read the thread ghozi
    No, it can be anything from 1-5 part numbers.

  10. #10
    Registered User
    Join Date
    02-03-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Extracting all text from parentheses (including parentheses)

    Thanks martindwilson - that worked perfectly. It might not be the prettiest solution but it has saved me a huge amount of work

  11. #11
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Extracting all text from parentheses (including parentheses)

    If all strings have the same structure Data-Text to columns also does the job

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extracting all text from parentheses (including parentheses)

    yea thats a point,then join them up after

  13. #13
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Extracting all text from parentheses (including parentheses)

    Slightly shorter than Martins', seems to work ok.

    This is setup for up to 6 number groups, if you need more drag C2 across as required, and extend the concatination in B2 to suit.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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