Friday, August 12, 2011

Extract data within brackets

Problem:
I want the word in brackets to appear only (Under the Class Column). Eg:

Degree Class
BACC(MERIT) MERIT

Answer:
You can use the formula


=MID(A2,SEARCH("(",A2)+1,SEARCH(")",A2)-1-SEARCH("(",A2))

Or TEXT-TO-COLUMN with “(“ as the separate. To remove the “)” use find “)” and replace with nothing.

Problem:
What if I want the data from within the 2nd bracket?
Degree Class
B.ENG.(CHEM.& BIOMOL.ENG.)(SECOND LOWER) SECOND LOWER

Answer:

You can use the formula.

=MID(A2,SEARCH("(",A2,SEARCH("(",A2)+2)+1,LEN(A2)-SEARCH("(",A2,SEARCH("(",A2,SEARCH("(",A2)+2))-1)