Text

SUBSTITUTE

Swap matching text for replacement text, optionally limiting the change to one occurrence.

Syntax

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

Worked example

Replace both hyphens with slashes.

=SUBSTITUTE("AB-2-4","-","/")

Result AB/2/4

Microsoft documentation

Check the arguments, supported editions and behavior of this function in Microsoft’s reference.

Microsoft reference

Search ExcelTutor