SUBSTITUTE Function Syntax

A function’s syntax refers to the layout of the function and includes the function’s name, brackets, and arguments. The syntax for the SUBSTITUTE function is: The arguments for the function are:

Text (required): The data containing the text to be replaced. This argument can contain the actual data enclosed in quotation marks (see row 2 in the image above) or a cell reference to the location of the text data in the worksheet (see rows 3 and 4). Old_text (required): The text to be replaced. New_text (required): The text that will replace Old_text. Instance_num (optional): A number. If this number is omitted, every instance of Old_text is replaced with New_text. If this number is included, the instances of Old_text specified are replaced (see row 5).

Use the SUBSTITUTE Function

Although it is possible to type the entire formula manually into a worksheet cell, another option is to use the Function Arguments dialog box (or the Formula Builder in Excel for Mac) to enter the function and its arguments into a cell. When you use the dialog box, Excel takes care of separating each argument with a comma and it encloses the old and new text data in quotation marks.

SUBSTITUTE vs. REPLACE Functions

SUBSTITUTE differs from the REPLACE function in that it is used to exchange specific text at any location in the selected data. REPLACE is used to replace any text that occurs at a specific location in the data.