Excel SUBSTITUTE function

Function              SUBSTITUTE

Description        Excel SUBSTITUTE function substitutes new_text for old_text in a text string. Use SUBSTITUTE when you want to replace specific text in a text string.

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

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.

Example:

Case 1: When it don’t require to use instance_num

Case 2: When you require the instance_num but you don’t put it and SUBSTITUTE function changes all old_text with new_text

Case 3: When you require the instance_num and you put it then SUBSTITUTE function changes only that occurrence of old_text with new_text