+ Reply to Thread
Results 1 to 11 of 11

How to extract text in between LAST set of parentheses?

  1. #1
    Registered User
    Join Date
    04-27-2015
    Location
    Los Angeles
    MS-Off Ver
    2011
    Posts
    10

    How to extract text in between LAST set of parentheses?

    I found this formula for extracting text in between parentheses. The formula goes in an empty column and it gets the text from the column before it:

    =MID(B1,FIND("(",B1)+1,FIND(")",B1)-FIND("(",B1)-1)

    How do I change it so that it finds the text in the LAST set of parentheses. Some, but not all, of the fields have multiple sets of parentheses.

    TIA!!!

  2. #2
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: How to extract text in between LAST set of parentheses?

    Hi Kioken,
    Very confusing actually also it is working on my system perfectly okay.

    What I have understood, as per that i tried using the mentioned formula for extracting text from parentheses e.g. (XXXXXX) so expected result should be XXXXXX

    And your formula worked superbly fine. Could you please share some of the text you are trying to extract??
    Thanks
    Nisha Dhawan


    If you like my answer please click on * Add Reputation
    "If you can dream it, You can do it "

  3. #3
    Registered User
    Join Date
    04-27-2015
    Location
    Los Angeles
    MS-Off Ver
    2011
    Posts
    10

    Re: How to extract text in between LAST set of parentheses?

    For example:

    BERGOGNONE (AMBROGIO DA FOSSANO) (Italian)

    I just need to get "Italian" into a new column. The formula I found produces "AMBROGIO DA FOSSANO" instead.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to extract text in between LAST set of parentheses?

    Try this

    =SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,"(",REPT(" ",50)),50)),")","")

    Row\Col
    A
    B
    1
    BERGOGNONE (AMBROGIO DA FOSSANO) (Italian) Italian
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: How to extract text in between LAST set of parentheses?

    =trim(left(right(substitute(substitute("()"&a1,"(",rept(" ",len(a1))),")",rept(" ",len(a1))),len(a1)*2),len(a1)))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    04-27-2015
    Location
    Los Angeles
    MS-Off Ver
    2011
    Posts
    10

    Re: How to extract text in between LAST set of parentheses?

    Quote Originally Posted by AlKey View Post
    Try this

    =SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,"(",REPT(" ",50)),50)),")","")

    Row\Col
    A
    B
    1
    BERGOGNONE (AMBROGIO DA FOSSANO) (Italian) Italian
    Thanks! That sort of works!

    Sometimes there is text after the parentheses, though:

    TINTORETTO, JACOPO (JACOPO ROBUSTI) (Italian), workshop

    And it returns "Italian, workshop" instead of just "Italian".

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to extract text in between LAST set of parentheses?

    Quote Originally Posted by AlKey View Post
    Try this

    =SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(A1,"(",REPT(" ",50)),50)),")","")
    That will fail if there's text after the last set of ( ).

    A1 = (1) (2) (3) (4) (5) xxx

    Formula returns 5 xxx
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Registered User
    Join Date
    04-27-2015
    Location
    Los Angeles
    MS-Off Ver
    2011
    Posts
    10

    Re: How to extract text in between LAST set of parentheses?

    Quote Originally Posted by nflsales View Post
    =trim(left(right(substitute(substitute("()"&a1,"(",rept(" ",len(a1))),")",rept(" ",len(a1))),len(a1)*2),len(a1)))
    I think that did it! Thank you so much!!! =)

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: How to extract text in between LAST set of parentheses?

    you are welcome and thanks for your feedback

  10. #10
    Registered User
    Join Date
    04-27-2015
    Location
    Los Angeles
    MS-Off Ver
    2011
    Posts
    10

    Re: How to extract text in between LAST set of parentheses?

    Oh, you saved the day. It's a thing of beauty. =)

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to extract text in between LAST set of parentheses?

    It would've been more helpful to know beforehand that there is text after the parentheses.

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,")","("),"(",REPT(" ",50)),50*3,50))

+ 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. Extract Text in Parentheses From One Cell to Another
    By Dhyre in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-13-2020, 04:10 AM
  2. Executing methods - parentheses or no parentheses?
    By dmasters4919 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-23-2015, 07:57 PM
  3. [SOLVED] Extracting all text from parentheses (including parentheses)
    By j4ke101 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-10-2013, 08:03 AM
  4. Extracting text within a parentheses
    By mridul1984 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2013, 02:11 AM
  5. Replies: 6
    Last Post: 01-13-2011, 03:00 AM

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