Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Use the SUBSTITUTE Function in Excel

Learn how to use SUBSTITUTE Function in Excel, including its purpose, syntax, examples, and common errors, with clear step-by-step guidance.

Table of Contents

This guide explains how to use SUBSTITUTE Function in Excel, including its syntax, required arguments, practical examples, and common errors.

Description: The function replaces 1 or the old character string into a new text string and allows alternatives at one or more locations.

Syntax: SUBSTITUTE (text, old_text, new_text, [instance_num]) .

Inside:

- text : The text contains the content to be replaced, required parameters.

- old_text : The old text string to be replaced, is a required parameter.

- new_text : The new text string replaces the old text string, which is a required parameter.

- instance_num : The position you want to replace, is an optional parameter.

For example:

Perform instead in the following data table:

How to Use the SUBSTITUTE Function in Excel screenshot

- Replace in the first position found: Want to replace the string 2016 in the first position in cell C6 to 2020.

In the cell to calculate enter the formula: = SUBSTITUTE (C6, D6, E6, 1) .

How to Use the SUBSTITUTE Function in Excel screenshot 2

Pressing Enter results as:

How to Use the SUBSTITUTE Function in Excel screenshot 3

- Replace all strings found:

In the cell to get new values enter the formula: = SUBSTITUTE (C6, D6, E6) .

How to Use the SUBSTITUTE Function in Excel screenshot 4

Pressing Enter results as:

How to Use the SUBSTITUTE Function in Excel screenshot 5

Thus to replace all you ignore the replacement position.

- The replacement position is outside the value of the original string :

Suppose you want to replace 2016 in cell C6 in 3rd place but 2016 only in 2nd place you do the following:

In the cell to get new values enter the formula: = SUBSTITUTE (C6, D6, E6,3) .

How to Use the SUBSTITUTE Function in Excel screenshot 6

Pressing Enter results returns:

How to Use the SUBSTITUTE Function in Excel screenshot 7

So if the replacement request is not on the original string, the replacement is ignored and returns the original string.

Similar to the remaining data when replacing 2 words.

How to Use the SUBSTITUTE Function in Excel screenshot 8

Also, if you do not leave the replacement string in Excel cells, you put the values in quotation marks to identify it as a string. For example: SUBSTITUTE (C6, "2016", "2020", 1) .

Above is how to use the SUBSTITUTE function to help you save time when working. Good luck!

FAQ

What does the SUBSTITUTE function do in Excel?

The SUBSTITUTE function performs the calculation described in this guide. Use the correct arguments and compatible data types for reliable results.

How do I enter the SUBSTITUTE function correctly?

Start with an equals sign, enter SUBSTITUTE, add the required arguments inside parentheses, and confirm that cell references and separators are correct.

Why does the SUBSTITUTE function return an error?

Common causes include missing arguments, invalid data types, incorrect cell references, unsupported values, or regional separator settings.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.