Welcome to Excel Jet Consult blog post. In this tutorial, we going to see how to substitute square brackets with single pipe. Let’s get started
SUBSTITUTE Function
The SUBSTITUTE Function replaces existing text with new text in a text string
Syntax: =SUBSTITUTE(text, old_text, new_text, [instance_num])
Sample Data
In the caption below, we have Account Manager’s name and numbers inside square bracket. Essentially, we want to replace the open and close square brackets with single pipe
Formula
In cell B2, execute the formula: =SUBSTITUTE(SUBSTITUTE(A2,” [“,” | “),”]”,””)
A2 is the text; ” [” is the old text to replace; ” | ” is the new text; “]” is the old text of the SUBSTITUTE outside while “” empty string is the new text.
Click Enter
In the caption below, we can see that we have replaced the square bracket with simple pipe