SUBSTITUTE

replaces old text with new text · from excel · excel: not yet compared · sheets: not yet compared

signature

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

returns: text

argumentrequired
text required
old_text required
new_text required
instance_num optional

examples

formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.

fx =SUBSTITUTE("Sales Data", "Sales", "Cost") Cost Data

related

  • ASC converts full-width characters to half-width
  • BAHTTEXT spells a number as thai baht and satang
  • CHAR returns the character for a character-set code
  • CLEAN removes non-printable characters
  • CODE numeric code of the first character
  • CONCAT joins multiple text strings into one