Closed Thread
Results 1 to 16 of 16

Formula to remove Brackets and Text in brackets

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Formula to remove Brackets and Text in brackets

    Hi All

    I need a formula that will remove the Brackets and Text from within Cells in a row. My issue is that there are certain instances where the are multiple brackets to be removed. The source date is not mine so i cannot edit it. Alternatively a VBA to do the same thing may be better. There are only a maximum of 25 rows. Here are the examples of how the text appears in the sheet attached. There are also instances where there is a "*" out of the brackets. I'm not too fussed about removing that but if something could be incorporated into the formula to remove that would be great.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Formula to remove Brackets and Text in brackets

    do you just wish to have everything between the first open bracket and the last closed bracket removed?

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Formula to remove Brackets and Text in brackets

    Perhaps
    =IFERROR(TRIM(SUBSTITUTE(LEFT(A1,SEARCH("(",A1,1)-2)&MID(A1,FIND("@",SUBSTITUTE(A1,")","@",LEN(A1)-LEN(SUBSTITUTE(A1,")",""))),1)+1,40),"*","")),A1)

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

    Re: Formula to remove Brackets and Text in brackets

    array formula (CSE)
    =IFERROR(SUBSTITUTE(REPLACE(A1,FIND("(",A1),MAX(IF(MID(A1,ROW($A$1:$A$100),1)=")",ROW(($A$1:$A$100))))-FIND("(",A1)+1,""),"*",""),A1)

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula to remove Brackets and Text in brackets

    Another one

    B1
    =SUBSTITUTE(REPLACE(A1,FIND("(",A1&"("),IFERROR(MATCH(2,INDEX(1/(MID(A1,ROW(INDIRECT("1:90")),1)=")"),))-FIND("(",A1)+2,),"")," *","")

  6. #6
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Formula to remove Brackets and Text in brackets

    Thanks for both of your solutions. Just one other thing that I forgot to mention was that In the rows where there is blank data I would like the cell to be blank, Ive tried to add another IFERROR...."", but i'm struggling to get it in the correct place (or dont know if you can have 2) and some of the names are in CAPS so want to the use the PROPER function?

    Thanks

  7. #7
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Formula to remove Brackets and Text in brackets

    Hi,

    I've tried the
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However I get the following message - "This formula uses more levels of nesting than you can use in the current file format". I should have mentioned that the workbook im using is an XLS office 97-2003 format. I do need to change it to an XLSM, but at the moment its not possible due to a VBA script that i need to do a bit of work with to adjust to the XLSM format.

    Any help would be appreciated

  8. #8
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Formula to remove Brackets and Text in brackets

    I should also have mentioned in the source data, the names are reversed so "Smith (ABC) John"

    I have also just converted the file to XLSM now so we can go back to using more updated formulas - sorry for the inconvenience!

    John
    Last edited by jshaw82; 01-31-2019 at 12:15 PM. Reason: added text

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

    Re: Formula to remove Brackets and Text in brackets

    I should also have mentioned in the source data, the names are reversed so "Smith (ABC) John"
    A 'low tech' way to do this might be to use the formula in post #7 as a helper and then use the following to produce a final result:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,494

    Re: Formula to remove Brackets and Text in brackets

    This should work, too:

    =TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),90)&" "&LEFT(A1,FIND(" ",A1)-1))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  11. #11
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Formula to remove Brackets and Text in brackets

    Hi, Thanks for the responses. Ive been busy an just had chance to look at this.

    I already have a helper cell that's rearranging the data. Honestly the source data on such a mess with with brackets and "*" and all sorts I just want to make it look as it should. Ive extracted what ive already got to the attached as I was slightly off with my original source data ordering.

    So I want the cell to display John Smith, Paul Jones - that's it. no () or *

    If put the cells in the place they are in my spreadsheet with an example of my existing attempts

    Thanks again in advance

    John
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,494

    Re: Formula to remove Brackets and Text in brackets

    Try this:

    =PROPER(TRIM(LEFT(SUBSTITUTE(MID(C6,FIND(" ",C6)+1,99)," ",REPT(" ",99)),50))&" "&LEFT(C6,FIND(" ",C6)-1))

    Excel 2016 (Windows) 32 bit
    B
    C
    D
    5
    Names
    Engineer Name
    AliGW
    6
    (Def) Smith
    SMITH JOHN (ABC) (DEF)
    John Smith
    7
    (Wxyz) Jones
    JONES PAUL * (WXYZ)
    Paul Jones
    8
    Andy Gray
    GRAY ANDY
    Andy Gray
    9
    Alex Mcleish
    MCLEISH ALEX
    Alex Mcleish
    10
    Mark Wright
    WRIGHT MARK
    Mark Wright
    11
    Kirk Maddison
    MADDISON KIRK
    Kirk Maddison
    12
    Kurt Russell
    RUSSELL KURT
    Kurt Russell
    13
    Nick * Berry
    BERRY NICK *
    Nick Berry
    Sheet: Sheet1

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,494

    Re: Formula to remove Brackets and Text in brackets

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  14. #14
    Registered User
    Join Date
    06-27-2022
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    10
    Posts
    2

    Re: Formula to remove Brackets and Text in brackets

    Sir
    Please give me a formula by which i will be able to substitute brackets & inside brackets data.
    Please do not use VBA.

    e:g- W=41CM (16.14") L=55CM (21.65") F=8CM (3.15")

    formula should get above statement like this W=41CM L=55CM F=8CM


    Regards
    Sonjoy Paul

  15. #15
    Registered User
    Join Date
    06-27-2022
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    10
    Posts
    2

    Re: Formula to remove Brackets and Text in brackets

    Sir
    Please give me a formula by which i will be able to substitute brackets & inside brackets data.
    Please do not use VBA.

    e:g- W=41CM (16.14") L=55CM (21.65") F=8CM (3.15")

    formula should get above statement like this W=41CM L=55CM F=8CM


    Regards
    Sonjoy Paul

  16. #16
    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
    43,986

    Re: Formula to remove Brackets and Text in brackets

    Sonjoy

    Hi.

    It's a forum rule that you start your own thread, rather than "piggy-backing" on someone else's thread. This helps prevent massive confusion arising - which will happen if it is not clear which question is being answered. So please start your own thread and explain your own problem (make sure that, right from the start, you use a meaningful title (NOT things like "help needed" or "urgent problem"... think of the Google search terms that you would use to find the solution).

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 pictures. So, prepare a SMALL sample sheet (10-20 rows, not thousands!!!). Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!


    The yellow banner about sample worksheets, at the top of the screen tells you how to post a sheet here on the Forum.
    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

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Summing brackets, when you have multiple brackets per cell
    By tmiller1002 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-26-2017, 11:22 AM
  2. [SOLVED] How to RemoVe all text between brackets
    By drhema in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-13-2014, 12:02 PM
  3. Remove text between [brackets]
    By Benni5555 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-26-2014, 01:17 AM
  4. [SOLVED] Automating Brackets, and Sum above Brackets in Excel Chart
    By cartica in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 07-24-2014, 11:33 AM
  5. [SOLVED] Formula to remove brackets, full stops, commas and spaces
    By MikeNificent in forum Excel General
    Replies: 4
    Last Post: 07-27-2012, 12:45 AM
  6. Need formula to remove brackets from string of numbers
    By happycats in forum Excel General
    Replies: 7
    Last Post: 07-11-2012, 09:19 PM
  7. Replies: 5
    Last Post: 04-19-2012, 09:02 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