Texteasy
SUBSTITUTE()
Replaces existing text with new text in a string. Match by content.
Syntax
fx
=SUBSTITUTE(text_to_search, search_for, replace_with, [occurrence_number])
Arguments
Example
fx
=SUBSTITUTE("a-b-c", "-", ", ")
Paste this into Google Sheets to run it. The live playground on this site covers 24 of the 61 functions, and SUBSTITUTE isn't one of them yet.
Common pitfalls
- Replaces ALL occurrences by default. Pass the optional 4th arg
occurrence_numberto replace only the Nth. - Case-sensitive: to replace case-insensitively, use
REGEXREPLACEwith the(?i)flag in the pattern. - If
search_foris empty (""), Sheets returns the original text unchanged: no error.
Related formulas
Used by