Search code examples
excelvbaparentheses

Deleting values between first two parentheses


I have values in more than 10,000 rows which are [Name] [TypeofData] Option .

I need output which will be: [TypeofData] Option

Some function to delete [Name]?

enter image description here


Solution

  • You can use MID():

    =MID(A1,SEARCH("[",A1,SEARCH("[",A1)+1),LEN(A1)-SEARCH("[",A1,SEARCH("[",A1)))
    

    SUBSTITUTE() also seems to work:

    =SUBSTITUTE(A1,LEFT(A1,SEARCH("]",A1)),"",1)
    

    Note: I'd wrap TRIM() around those just to be safe.