SUBSTITUTE function

2016-05-30

What Does It Do?

 

This function will allow you to find and replace a piece of text within a text string. You can either replace all occurrences of the piece of text or just a particular instance of it.

 

Syntax

 

SUBSTITUTE(Text, Find, Replace, Instance)

  • Text (required) – This is the text you are going to search.
  • Find (required) – This is the piece of text you want to find.
  • Replace (required) – This is the piece of text you want to replace it with.
  • Instance (optional) – This is the instance number of the text you want to find and replace. If nothing is entered the function will replace all instances of the text you’re trying to find.

 

Example

 

In this example we replace certain parts of the text string “What did he say he did?”. In the first example we replace all instances of the word “he” with “I”. In the second example we replace the second instance of the word “did” with “ate”. Note that text is case sensitive, in the last example the function does not replace “What” with “Ninja” because the “W” is capitalised.

 

=SUBSTITUTE(B3,C3,D3)

 

SUBSTITUTE-Example-001 SUBSTITUTE function

 

Get The Example Workbook

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Subscribe

Advertisement

Related Articles

UPPER function

This function will convert text to all uppercase letters. Syntax UPPER(Text)...

read more

LOWER function

This function will convert text to all lower case letters. Syntax LOWER(Text)...

read more

Comments

0 Comments

Submit a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get The Latest News

Follow Us

Follow us on social media to stay up to date with the latest tips in Excel!

Pin It on Pinterest

Share This