Remove Brackets Effectively in Excel with 5 Methods

In any Excel spreadsheet, brackets can appear in various forms, such as within cell content, formulas, or as part of data. To remove brackets in Microsoft Excel, you can use different methods depending on the context. In this article, I’m going to discuss 5 ways to remove unwanted brackets in Excel.

The dataset I’m going to use for this article consists of two columns. First,  the List of Cities (With Unwanted Brackets) column contains the list of cities with the country name inside brackets. Then, the List of Cities (After Removing Brackets) column contains the list of cities after removing the brackets around the city names.

Dataset to remove brackets in Excel

Remove Brackets in Excel Using Find and Replace

A simple way to remove brackets in Excel is by using Excel’s Find and Replace command. To demonstrate this process, I am taking only the column List of Cities from the dataset:

Dataset to remove bracket with Find and Column command

To remove brackets in Excel using Find and Replace command, follow these steps:

  1. Select your data first.
  2. Now, press CTRL+ F from the keyboard. The Find and Replace dialog box will open.Find and Replace dialog box to remove brackets in Excel
  3. At the Find what section type “(“ and keep the Replace with section blank.
    I left the Replace with section empty since I want to get rid of the brackets and don’t want anything to take over their place.
  4. Press Replace All.
    You will find that all the left brackets (“ are cleared from the dataset.Inserted starting bracket in the Find What box in the Find and Replace dialog box
  5. Similarly, insert )” in the Find what box.
  6. Leave the Replace with box empty.
  7. Finally, press Replace All.

This will remove the closing parentheses )” from the dataset.Inserted ending bracket in the Find What in the Find and Replace dialog box

The opening and closing brackets are searched separately because there are different words inside the brackets in the cells.

Remove Brackets in Excel Using the SUBSTITUTE Function

The SUBSTITUTE function allows you to replace occurrences of a specified substring within a given text with another substring. When dealing with brackets, you can use the nested SUBSTITUTE functions to systematically remove both opening and closing brackets, leaving you with clean text.

Syntax

=SUBSTITUTE(SUBSTITUTE(<original_text>, <text_to_replace_1>, <replacement_1>), <text_to_replace_2>, <replacement_2>)

Formula

=SUBSTITUTE(SUBSTITUTE(A2, "(", ""), ")", "")

Formula Explanation

  • This formula uses two SUBSTITUTE functions to remove both opening and closing brackets from the text in cell A2.
  • SUBSTITUTE(A2, “(“, “”): This replaces all occurrences of “(” (opening bracket) with an empty string in the text from cell A2
  • SUBSTITUTE(<result of inner SUBSTITUTE>, “)”, “”): This takes the result from the inner SUBSTITUTE (which is the text without opening brackets) and replaces all occurrences of “)” (closing bracket) with an empty string.

Steps to remove brackets in Excel with SUBSTITUTE function:

  1. First, select an empty cell.
  2. Then, copy and paste this formula: =SUBSTITUTE(SUBSTITUTE(A2, “(“, “”), “)”, “”)
    Remove Brackets in Excel with the SUBSTITUTE Function
  3. Press ENTER to insert the formula.Shown result after using the SUBSTITUTE Function to Remove Brackets in Excel
  4. Next, drag the Fill Handle to copy the formula to the rest of the cells.

Now, see the result. Thus, using this technique, you can remove brackets from Excel sheets.Displaying the result after removing the brackets in Excel

Remove Brackets in Excel with the REPLACE and the FIND Functions

In Excel, the REPLACE function provides a direct method to eliminate particular characters like brackets from the text in cells. By employing REPLACE, you can substitute a segment of text with an empty string, effectively erasing the unwanted characters.

Syntax

=REPLACE(REPLACE(Text, FIND("(", Text), 1, ""), FIND(")", REPLACE(Text, FIND("(", Text), 1, "")), 1, "")

Formula

=REPLACE(REPLACE(A2, FIND("(", A2), 1, ""), FIND(")", REPLACE(A2, FIND("(", A2), 1, "")), 1, "")

Formula Explanation

  • FIND(“(“, A2):  The FIND function is used to locate the position of the opening bracket “(“ in the text of cell A2. It returns the position (character number) of the first occurrence of “(“ in the text.
  • REPLACE(A2, FIND(“(“, A2), 1, “”): This part of the formula replaces the first occurrence of “(“ with an empty string in the text from cell A2.
  • REPLACE(text, start, num_chars, new_text) is the syntax of the REPLACE function. In this case: text is the content of cell A2. start is the position returned by FIND(“(“, A2), indicating where the “(“ was found. num_chars is set to 1, indicating you want to replace 1 character (the opening bracket). new_text is an empty string “”, meaning you are replacing the opening bracket with nothing.
  • FIND(“)”, REPLACE(A2, FIND(“(“, A2), 1, “”)): This part of the formula locates the position of the closing bracket “)” in the text after removing the opening bracket using the REPLACE function from the previous step.
  • REPLACE(…, FIND(“)”, REPLACE(A2, FIND(“(“, A2), 1, “”)), 1, “”): Similar to the first REPLACE, this part replaces the first occurrence of “)” with an empty string in the text after removing the opening bracket. The start position is the result of FIND(“)”, REPLACE(A2, FIND(“(“, A2), 1, “”)), which gives the position of the first closing bracket.

Steps to remove brackets in Excel with the REPLACE and the FIND functions:

  1. Select a cell.
  2. Copy this formula: =REPLACE(REPLACE(A2, FIND(“(“, A2), 1, “”), FIND(“)”, REPLACE(A2, FIND(“(“, A2), 1, “”)), 1, “”)
  3. Now, paste it into the selected cell.
  4. Press ENTER to insert the formula.Remove Brackets in Excel with the REPLACE and the FIND Functions
  5. Next, drag the Fill Handle to copy the formula from cell range B2:B10.

This is another way to remove brackets in Excel using the REPLACE and FIND functions. See the final result here:Displaying result after removing the brackets with REPLACE and FIND functions

Remove Brackets in Excel Using the CLEAN Function

If you have text data containing brackets that you need to eliminate, combining the CLEAN function with the SUBSTITUTE function provides a straightforward way to achieve this.

Syntax

=CLEAN(SUBSTITUTE(SUBSTITUTE(TargetCell, "(", ""), ")", ""))

Formula

=CLEAN(SUBSTITUTE(SUBSTITUTE(A2, "(", ""), ")", ""))

Formula Explanation

If your text is in cell A2, this formula aims to remove both opening and closing brackets from the text while also removing any non-printable characters that might be left.

  • SUBSTITUTE(A2, “(“, “”): The innermost SUBSTITUTE function removes all occurrences of “(” (opening bracket) from the text in cell A2 by replacing them with an empty string.
  • SUBSTITUTE(<result of inner SUBSTITUTE>, “)”, “”): The result from the inner SUBSTITUTE is used as the text for this second SUBSTITUTE function. This function replaces all occurrences of “)” (closing bracket) with an empty string, further cleaning the text from any closing brackets.
  • CLEAN(…): The CLEAN function takes the result from the second SUBSTITUTE as its input.

Follow these steps to remove brackets with the CLEAN function:

  1. First, select an empty cell.
  2. Copy the formula: =CLEAN(SUBSTITUTE(SUBSTITUTE(A2, “(“, “”), “)”, “”))
  3. Paste the formula into the cell.
  4. Press ENTER to insert the formula.Remove Brackets in Excel Using the CLEAN Function
  5. Next, drag the Fill Handle to copy the formula to the rest of the cells.

Here’s the final result after removing the brackets in Excel.Result of using the CLEAN Function to Remove Brackets in Excel

Clear Brackets in Excel Using VBA

VBA is the short form of Visual Basic for Applications. I am creating a custom VBA function to remove brackets from a given dataset. The number and types of brackets can be different in the cells. To show you the variation in the text strings, I am using a slightly different dataset here:

Dataset to remove brackets in Excel

Go through these steps with a VBA code to remove brackets:

  1. Press Alt + F11 to open the VBA editor within Excel.
  2. In the Visual Basic Editor, click Insert > Module to insert a new module.
  3. Copy and paste the following VBA code into the module window:
    Sub KeepTextWithoutBrackets()
    
        Dim InputRange As Range
        Dim OutputCell As Range
        Dim Cell As Range
        Dim TempStr As String
        Dim i As Integer
    
        ' Prompt the user to select the range
        On Error Resume Next
        Set InputRange = Application.InputBox("Select a range containing text:", Type:=8)
        On Error GoTo 0
    
        If InputRange Is Nothing Then
            Exit Sub
        End If
    
        ' Prompt the user to select the starting cell for output
        On Error Resume Next
        Set OutputCell = Application.InputBox("Select a starting cell for the output:", Type:=8)
        On Error GoTo 0
    
        If OutputCell Is Nothing Then
            Exit Sub
        End If
    
        ' Loop through each cell in the selected range
        For Each Cell In InputRange
            TempStr = ""
            ' Loop through each character in the cell value
            For i = 1 To Len(Cell.Value)
                If InStr("(){}[]", Mid(Cell.Value, i, 1)) = 0 Then
                    ' Append the character to TempStr if it's not a bracket
                    TempStr = TempStr & Mid(Cell.Value, i, 1)
                End If
            Next i
            ' Output the modified text (without brackets) in the corresponding cell
            OutputCell.Value = TempStr
            Set OutputCell = OutputCell.Offset(1, 0)
        Next Cell
    
    End Sub

    Remove Brackets in Excel Using Customized VBA Code

  4. Press the F5 key on the keyboard.
    It will run the code. Alternatively, you can select the Run command.
    The Input dialog box will pop up for the input range.
  5. Manually type the cell range $A$2:$A$10 or select it from the worksheet.
  6. Hit OK.Inserted the range to the Input dialog box
  7. To display the output, insert the first cell of the output column, B2 or $B$2.
  8. Click on the OK button.Inserted the starting cell for the output dialog box

Now close the VBA interface.
Inserted a VBA code in the Visual Basic Editor in Excel Here are the final output. In this way, you can get the filtered dataset where the brackets are removed.Final Result after removing the brackets in Excel

Conclusion

In conclusion, there are several ways to remove brackets in Microsoft Excel. Depending on your data type and your needs, you can select the method that works best for you. If your dataset contains different types of brackets, the methods mentioned in this article will work for you.

Happy Excelling!

Frequently Asked Questions

How do I remove text before brackets in Excel?

To remove text before brackets in Excel, follow these steps:

  1. Select the cells containing the text you want to remove.
  2. Press CTRL + H to open the Find and Replace dialog.
  3. In the Find what box, type an asterisk (*) followed by an opening bracket such as “*[“.
  4. Leave the Replace with box empty.
  5. Finally, press Replace All.

This method allows you to efficiently delete text before brackets in Excel cells.

How to remove parentheses from phone numbers in Excel?

To remove parentheses from phone numbers in Excel, use the “Find and Replace” feature:

  1. Select the cells containing the phone numbers.
  2. Press CTRL + H to open the Find and Replace dialog.
  3. In the Find what box, type an opening parenthesis “(“.
  4. Leave the Replace with box empty.
  5. Click Replace All.

This process will swiftly eliminate the parentheses from your phone numbers in Excel.

5/5 - (1 vote)

Leave a Reply

Your email address will not be published. Required fields are marked *