Let us assume, I have texts in the first column, which are between two brackets or parentheses.
Profession
(Programmer, blogger)
(Scientist)
(Accountant)
(Mechanic)
I want to separate the profession (the job) by removing the two brackets (or parentheses) and show it in separate column.
Here's the formula.
=SUBSTITUTE(SUBSTITUTE(A2,"(",""),")","")
The SUBSTITUTE function
The SUBSTITUTE function substitutes a "new text" for "old text" in a string. In-fact, it replaces the old text or value with a new text or value. This is exactly what we did in the above formula to remove "parentheses" from texts. We "replaced" the open and close brackets with "nothing" or blank.
Syntax of SUBSTITUTE
SUBSTITUTE(text, old_text, new_text, [instance_num])
text: The text or cell address containing text that you want to substitute. This is required.
old_text: The text you want to substitute or replace. This is required.
new_text: The text or string that you want to substitute old_text with. This is required.
instance_num: You can use this option to specify which occurrence of old_text you want to replace with new_text. This is optional, but useful in some cases. For example, I have two texts both within parentheses.
(Programmer), (26)
I want to remove the brackets from the first text and keep the brackets in the second text, that is (26). So, here I can use the instance_num argument of the SUBSTITUTE() function and this is how I'll write the formula.
Formula to Replace Parentheses with another text
Here's another example using the "SUBSTITUTE()" function.
I have some data in my worksheet like this.
Name
Arun (Programmer), (blogger)
Charlie (Scientist)
Mike (Perfusionist)
Bravo (Mechanic)
and I want remove the brackets and replace it with the string, is a. Here's the formula.
=SUBSTITUTE(SUBSTITUTE(A2,"(","is a "),")","")