fbpx

How to Use SUBSTITUTE Function

Yodalearning>Tutorials>How to Use SUBSTITUTE Function

What is a Substitute function?

When can we use Substitute function?

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’.

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 Capita “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:

In    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.

Step 6 on Substitute Function

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

Hurray!!!

We have succeeded in the used of Substitute Function.

Yoda learning Group

Related Tutorials

The Ultimate Guide to Excel Pivot Table Slicers
June 12, 2018
How to Wrap Text in Excel Automatically and Manually
June 6, 2018
Unhide Column in Excel
June 5, 2018
Highlight row based on cell value
June 4, 2018
Learn how to remove blank cells in Excel
June 3, 2018
How to Group Numbers, Dates & Text in Pivot table in Excel
June 1, 2018
5 Powerful Tricks to Format cells in Excel
May 31, 2018
Insert a Picture into a Cell in Excel
May 25, 2018
What is ISFORMULA Function and FORMULATEXT Function
May 21, 2018
Excel Quartile Function in Excel
May 8, 2018
How to use the Excel PERCENTILE function
May 7, 2018
Insert or Type degree symbol in Excel with Autocorrect Feature
May 7, 2018
Insert Symbol Dialog Box to Insert or Type degree symbol in Excel
May 7, 2018
CHAR Formula to Insert or Type degree symbol in Excel
May 7, 2018
How to type degree symbol in Excel using Keyboard Shortcut
May 7, 2018
HOW TO FREEZE ROWS AND COLUMN IN EXCEL?
May 4, 2018
What are Reference Styles? How to Use R1C1 Reference Style in Excel
May 3, 2018
How to use the Histogram Tool in Excel (Step By Step Guide)
April 24, 2018
What is Flash Fill ? How to use flash fill in Excel ?
April 23, 2018
How TO TRACK CHANGES in MS Word
April 23, 2018
Undo – Redo Shortcuts Keys in Excel
April 18, 2018
How To Remove Blank Rows – The COUNTBLANK Function
April 9, 2018
How to match names in Excel where spelling differ or vary
April 9, 2018
Learn How to enable or disable scroll lock in Excel
April 7, 2018
How To Make Table of Contents (TOC)
April 2, 2018