REPLACE function
OriginalText
The original text string.
StartIndex
The position in the originalText
text string where the
newText
text string should be inserted.
Length
The number of characters that should be replaced.
NewText
The replacement text string.
Returns
The resulting text string.
Replaces a part of a text string with a different text string and returns the result. REPLACE("one two three", 5, 3, "2")REPLACE("one two three"; 5; 3; "2") returns "one 2 three". The second parameter, 5, is the position where "two" starts, and the third parameter, 3, is the length of the text string to replace, "two". The fourth parameter is the replacement text string.
Use SUBSTITUTE to replace text where the text to be replaced is known, but not its position. Use REGEXREPLACE to replace text using powerful regular expressions which find the text to replace.
Examples
Returns "one 2 three".
Returns the array { "one 2 three", "one TWO three" }{ "one 2 three"; "one TWO three" }.