Search code examples
excelexcel-formulaworksheet-function

How to remove parentheses and text inside from all rows in Excel


I want to delete parentheses and text inside them from each row. Text inside parentheses varies and "Find and replace" tool cannot be used. What I want to do can be seen from this figure:

enter image description here

Sometimes in rows parenthesess are absent. What kind of formula I can use so that it removes brackets and text and do not affect rows where no brackets given.


Solution

  • If the pattern is always the same you can use:

    In English

    =TRIM(MID(B2,FIND(")",B2)+2,999))

    In Russian (For Andrey)

    =СЖПРОБЕЛЫ(ПСТР(B2;НАЙТИ(")";B2)+2;999))

    To test whether the Cell has a ")" or not:

    =IF(NOT( ISERROR(FIND(")",B2))),TRIM(MID(B2,FIND(")",B2)+2,999)),B2)
    

    You will need to do the translation.

    Edit: The formula above can be written more simply. I got caught in fixing each problem without realizing there is an easier way.

    =IFERROR(TRIM(MID(B2,FIND(")",B2)+2,999)),B2)