SUBSTITUTE

SUBSTITUTE(text, old, new)

Replaces every occurrence of one piece of text with another, such as the separators in a WBS path. Unlike CONTAINS and =, it matches case exactly: replacing "civil" leaves "Civil" as it was.

Arguments

ArgumentWhat to give it
textThe text to change, like [WBS] or [Name]. Blank gives blank.
oldThe text to replace, with its capitals as they appear. Empty text changes nothing.
newWhat to put in its place. Use "" to remove old.

Examples

Formula
=SUBSTITUTE([WBS], " / ", " > ")

The task's WBS path with a different separator between the levels.

Formula
=SUBSTITUTE([Task code], "_", "-")

The task code with underscores turned into dashes, for matching codes from another system.

Formula
=SUBSTITUTE([Name], "  ", " ")

The task name with each double space made single.

Reach for something else when

You wantUse
To know whether the text has the part at allCONTAINS
Spaces removed from the ends onlyTRIM
Part of the text cut out by positionLEFT, MID or RIGHT

Common questions

Can I replace only the first occurrence?

No. SUBSTITUTE has no fourth argument as Excel's does; it always replaces every occurrence.

Why didn't SUBSTITUTE replace a word I can see?

It matches capitals exactly, unlike the rest of the text functions. Write old with the capitals the text has, or replace each spelling in turn: SUBSTITUTE(SUBSTITUTE([Name], "civil", "CIV"), "Civil", "CIV").