This Excel tutorial explains how to use the Excel REPLACE function with syntax and examples.
The Microsoft Excel REPLACE function replaces a sequence of characters in a string with another set of characters. Please note that the VBA version of the REPLACE function has different syntax.
The syntax for the Microsoft Excel REPLACE function is:
REPLACE( old_text, start, number_of_chars, new_text )
The REPLACE function can be used in the following versions of Microsoft Excel:
The REPLACE function can be used in Microsoft Excel as the following type of function:
Let's look at some Excel REPLACE function examples and explore how to use the REPLACE function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following REPLACE examples would return:
=REPLACE(A1, 1, 5, "Beta") Result: "Betabet Soup" =REPLACE(A2, 5, 2, "1234") Result: "tech1234thenet.com" =REPLACE("apples", 2, 5, "te") Result: "ate"
(scroll to see more)