+ Reply to Thread
Results 1 to 7 of 7

Remove String Within the Bracket and also the Bracket

  1. #1
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342

    Remove String Within the Bracket and also the Bracket

    Hi All,
    I need formula to remove a string or text within a bracket. For instance, (abc) to become abc or [abc] to become abc. Thanks in advance.
    Last edited by seanyeap; 04-23-2010 at 10:24 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Remove String Within a Bracket

    Your description seems more like remove the brackets.

    Remove String Within a Bracket

    (ABC) would become ()
    [ABC] would become []

    =SUBSTITUTE(SUBSTITUTE(A1,")",""),"(","")

    Modify for square brackets or nest 2 more SUBSTITUTES if both bracket types are required.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342

    Re: Remove String Within the Bracket and also the Bracket

    Hi Andy,
    I have edited the subject. A1 is 123(abc), I want the result is 123. I have tried =LEFT(A1,FIND(" ",A1)), but it does not return the result I want. Thanks again.

  4. #4
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342

    Re: Remove String Within the Bracket and also the Bracket

    Hi Andy,
    I think this =LEFT(A1,FIND("(",A1,1)-1) solved my problem.

  5. #5
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342

    Re: Remove String Within the Bracket and also the Bracket

    Hi,
    How do I incorporate =LEFT(A1,FIND("(",A1,1)-1) with =SUBSTITUTE((A1&" "&A2&" "&A3)," "," + ")? The aim is to delete string within the bracket then to join with "+" sign. Please refer to my attachment for better understanding. Thank you.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Remove String Within the Bracket and also the Bracket

    =concatenate(left(a2,find("(",a2)-1),"+",left(b2,find("(",b2)-1),"+",left(c2,find("(",c2)-1))

  7. #7
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342

    Re: Remove String Within the Bracket and also the Bracket

    Hi Andy,
    It is done with marvelous formula, I am so thankful for your help.

+ 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