This function will allow you to find and replace a piece of text within a text string. You can either replace all occurrences of the piece of text or just a particular instance of it.
Syntax
SUBSTITUTE(Text, Find, Replace, Instance)
Text (required) – This is the text you are going to search.Find (required) – This is the piece of text you want to find.Replace (required) – This is the piece of text you want to replace it with.Instance (optional) – This is the instance number of the text you want to find and replace. If nothing is entered the function will replace all instances of the text you’re trying to find.
Example
In this example we replace certain parts of the text string “What did he say he did?”. In the first example we replace all instances of the word “he” with “I”. In the second example we replace the second instance of the word “did” with “ate”. Note that text is case sensitive, in the last example the function does not replace “What” with “Ninja” because the “W” is capitalised.
Get The Example Workbook