⌨ Syntax
SUBSTITUTE(text,old_text,new_text,[instance_num])
Arguments
text
(required)
— The text or the reference to a cell containing text for which you want to substitute characters.
old_text
(required)
— The text you want to replace.
new_text
(required)
— The text you want to replace old_text with.
instance_num
(optional)
— Specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.
▶ Examples
=SUBSTITUTE(A3,"1","2",1)
=SUBSTITUTE(A4,"1","2",3)
=SUBSTITUTE(A2,"Sales","Cost")