SheetRocks
Documentation/Formulas/SUBSTITUTE

SUBSTITUTE

Returns the text after replacing one or more text strings with another text string

Syntax

SUBSTITUTE(text, old_text, new_text, [occurrence_number])

Arguments

Argument Description Required
text The text to search and replace with new_text Required
old_text The text to replace with new_text from the first argument text Required
new_text The string that will replace the old_text Required
occurrence_number Specifies which occurrence of old_text is to be replaced with new_text Optional

Examples

Replace all occurrences of text

=SUBSTITUTE("Hello World Hello", "Hello", "Hi")
Result ⇒ Hi World Hi

Replace specific occurrence

=SUBSTITUTE("Hello World Hello", "Hello", "Hi", 1)
Result ⇒ Hi World Hello

Replace text in cell value

=SUBSTITUTE(A1, "OLD", "NEW")
Result ⇒ Product-NEW-Version
A
1 Product-OLD-Version

Related Functions

Other Text functions:


← Back to Formula Reference