Excel Substitute Function

This post will guide you how to use Excel SUBSTITUTE function with syntax and examples in Microsoft excel.

Description

The Excel SUBSTITUTE function replaces a new text string for an old text string in a text string.

The SUBSTITUTE function is a build-in function in Microsoft Excel and it is categorized as a Text Function.

The SUBSTITUTE function is available in Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000, Excel 2011 for Mac.

Syntax

The syntax of the SUBSTITUTE function is as below:

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

Where the SUBSTITUTE function arguments are:
Text -This is a required argument. The text string that containing the old text to be substituted with new text string.
Old_text – This is a required argument. The substring that you want to replace.
New_text – This is a required argument. The new substring to replace Old_text substring with.
Instance_num – This is an optional argument.  The number value will specify which occurrence of old substring you want to replace with new substring.
Note: If Instance_num value is omitted, every occurrence of old substring will be replaced with new substring.

Example

The below examples will show you how to use Excel SUBSTITUTE Text function to replace old substring with a new substring.

#1 To substitute first instance of “excel”old text string with a new text string “Microsfot excel” in B1 cell, just using formula=SUBSTITUTE(B1,”excel”,” Microsfot excel”,1).

excel substitute function example1

#2  To substitute second instance of “excel”old text string with a new text string “excelfunction” in B1 cell, just using formula: =SUBSTITUTE(B1,”excel”,” excelfunction “,2).

excel substitute function example2

Comments

So empty here ... leave a comment!

Leave a Reply

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

Sidebar