Let’s first grasp what a Substitute Function is and when to use it. Before we figure out how to use the SUBSTITUTE function.

What is a Substitute function?

A Substitute is a person or a thing acting or serving in place of another. Substitute function replaces/swaps a set of characters with another in a text string.

For example, you can instruct the computer to substitute ‘and’ for ‘&’. Now, your instructions have to be clear if not the computer could interpret ‘Ander’ for say ‘&er’.

What is a Substitute function?

When can we use Substitute function?

When can we use substitute function?

You use the SUBSTITUTE function when you want to replace specific text in a text string. This differentiates it from REPLACE function. You use REPLACE when you want to replace any text that occurs in a specific location in a text string.

We will talk more about REPLACE function in our next article.

The Computer Language called SYNTAX

The Computer Language called SYNTAX

The instruction given to the computer while on the excel platform is called the SYNTAX. This command is:

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

For example, you can tell the computer to substitute ‘and’ for ‘&’. Now, your instructions have to be clear if not the computer could interpret ‘Ander’ for say ‘&er’.

Note that the SUBSTITUTE function is case sensitive. (Take a look at the highlighted words above). Though the instructions were the same, the results were different. The reason for this was the use of Capital “A” in the second case.

Step 1 on Substitute Function

Case Study:

Let’s say you have made your monthly report of sales made in October 2011. As shown in the diagram above. And you want to use a similar data for October 2016 monthly report.

You want to substitute: Sold for Bought; Toys for Cars; No for Number and 2016 for 2011

Step 1: Copy the above data in a new spreadsheet. Take note of the Column and Rows.

Step 2 on Substitute Function

Step 2: Fill in the Column Headings (Formula, Description, Result).

Step 3 on Substitute Function

Step 3: Under the result column, type in your instructions:

Cell E2: =SUBSTITUTE(B2, “Bought”, “Sold”)

Cell E3: =SUBSTITUTE(B3, “Cars”, “Toys”) 

Cell E4: =SUBSTITUTE(B4, “o”, “umber”, 1)

Cell E5: =SUBSTITUTE(B6, “1”, “6”, 2) 

Note: Start with “=“ and there is no space between SUBSTITUTE and the bracket open sign

If done, your result column will look like the one in the picture above.

Step 4 on Substitute Function

Step 4: Let’s write out the instruction again so we can very much remember it. This time we will write it under the Formula column. Type in

Cell C2: =SUBSTITUTE(B3, “Bought”, “Sold”)

Cell C3: =SUBSTITUTE(B4, “Cars”, “Toys”)

Cell C4: =SUBSTITUTE(B5, “o”, “umber”, 1)

Cell C5: =SUBSTITUTE(B6, “1”, “6”, 2)

Note: Start with a “Spacebar”.

Step 5 on Substitute Function

Step 5: Also for clearer understanding, let us give a description of the formula we used. So under the Description column, type in

Cell D2: Substitutes Sold for Bought

Cell D3: Substitutes Toys for Cars

Cell D4: Substitutes first instance of “o” with “number”

Cell D5: Substitutes second instance of “1” with “6” 

Your spreadsheet should look like the picture above.

Substitute Formula in Excel

Step 6: You can now hide any of the columns you don’t want to be displayed. You can always unhide it at any time, most especially for reference purpose.

In our case study, I will hide the Formula and Description columns

First, you select the column/columns you want to hide.

Next, right click on the mouse to bring down the menu

Then, select Hide

It will look the picture above

Note: To unhide, select the columns bounding the hidden column/columns. Right click on the mouse. Then select Unhide in the drop-down menu.

Step 7 on Substitute Function

Result: We have succeeded in the used of Substitute Function.

Related Tutorials

Connect to Data in Power Query
February 21, 2019
How to use Text to Column in Excel with 4 Difference Example
February 21, 2019
Things you should learn in Excel Course
February 13, 2019
How to use Clean Function in Excel
February 11, 2019
How to use the Excel Choose Function
February 11, 2019
How to use the Excel Code Function
February 11, 2019
How to use the Excel Column Function
February 11, 2019
How to use Ceiling Function in Excel
January 30, 2019
How to use Char Function in Excel
January 28, 2019
Text To Column in Excel | Split Cells
January 4, 2019
Pivot Tables (Complete Guidelines)
December 27, 2018
Power Bi Dax Deduplication Based On Column
December 17, 2018
Special Character Symbol List with Shortcodes in Excel
December 15, 2018
How to use AVERAGEIFS FUNCTION in Excel
December 10, 2018
How to use AVERAGEIF FUNCTION
December 10, 2018
How to use ABS Function in Excel
December 10, 2018
How to use AND Function in Excel
December 10, 2018
Delete Duplicate in Excel or Remove Duplicate in Excel
November 9, 2018
Excel Formulas and Functions in PDF
September 6, 2018
How To Lock Cells in Excel | Unprotect Excel
August 13, 2018
4x Faster at Excel
August 6, 2018
Separate Content of One Excel Cells into Separate Columns
August 3, 2018
How to Transpose Excel Columns to Rows | Paste Special Method
July 26, 2018
How to create sparklines in Excel
July 19, 2018
AutoSum in Excel with Shortcut
July 17, 2018