In this article, we will learn the difference between SUBSTITUTE vs REPLACE function.
Both functions work on TEXT editing. We replace or substitute the text using these functions.
SUBSTITUTE function finds the particular text and replaces it whereas REPLACE function replaces the text defined by its position.
Syntax of SUBSTITUTE
Syntax of REPLACE
We will perform the same task via both function to understand more.
Here we have the same text. We will perform multiple tasks on it.
Use Substitute function to replace 2013 to 2016 (First occurrence)
Use Replace function to replace 2013 to 2016 (First occurrence)
Now we need to replace both 2013 text
Use Substitute function to replace 2013 to 2016 (All occurrence)
Use Replace function to replace 2013 to 2016 (All occurrences)
<div="bbbb">=REPLACE(REPLACE(A5,17,4,B5),31,4,B5)
Nested REPLACE function replaces both texts
The results are in front of you. As we can see text been changed.
Hope you understood the difference between REPLACE and SUBSTITUTE function. Explore more Excel text functions here. Please state your queries here in the comment box below.
Related Articles:
Remove leading and trailing spaces from text in Excel
How to use RIGHT function in Excel
Remove unwanted characters in Excel
Extract Text From A String In Excel Using Excel’s LEFT And RIGHT Function
Popular Articles:
How to Use SUMIF Function in Excel
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.