Substitute Formula or Substitute Function in Excel with example

Substitute Formula or Substitute Function in Excel with example

Substitute

Function performs replacement of existing text in a text string. Other words Substitute function finds and replaces text (new_text) occurrences based on given text (old_text). Below is the syntax of substitute formula that we will understand by breaking into pieces.

Syntax

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

Parameters

  1. text: refers to the string text that you would like to use as input for substitute function. Its mandatory parameter.
  2. old_text: its mandatory parameter, refers to text that you would like to search within text (fist parameter).
  3. new_text: its mandatory parameter, refers to text that you would like to replace for each old_text.
  4. instance_num: its an optional parameter, refers to a number (a positive integer). It determines replacement only given position within string. If omitted, all found instances would be replaced.

Example

Output

Next >> Create your first distributable Excel Add-in or Plugin with example

Leave a Reply

Your email address will not be published. Required fields are marked *