Go Back

Excel REPLACE Function

Excel has some very effective ways to fix errors on spreadsheets. The REPLACE function in  Excel can replace text with new ones. It replaces characters with given location from a string with new text. In this tutorial, we will learn how the REPLACE function works in Excel.

Figure 1. Example of How to Use the Replace Function


=REPLACE (current_text, start_number, number_chars, new_text)


The REPLACE function uses four arguments. All of them are required for the function to work.

  • current_text – It is the text which we want to replace
  • start_number – It represents the position of the first character of the text we want to change.
  • number_chars – The number or characters we want to replace.
  • new_text – This is the text we want to replace the previous one with.


The REPLACE function alters a text with another one. We can replace the old text with a new one. All we need to do is input the arguments in the function. There are some important things to look out while working with this function. We need to provide the number of characters in the formula which need to be in a numeric form. Otherwise, it will show #VALUE! Error.

Setting up Data

The following example uses a student information database. Column A, B and C has the name, id and ages.

Figure 2. The Sample Data Set

In order to change the id handles using the REPLACE function, we need to

  • Select cell D2 with the mouse.
  • Write the function =REPLACE(B2,3,5,"DF") in the formula bar of D2.
  • Press Enter.

Figure 3. Applying the Formula

  • Select and drag the function from cells D2 to D6.

This will change show the new ids in column D.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

replace value on the summary tab. How to use replace value if formula has YTD and Y column that you want to replace
Solved by B. J. in 19 mins
How do you replace the sum of formula with its resulting digits. ie replace =SUM(J21:AC21) with 76
Solved by D. C. in 24 mins
I want to replace entire column............................................
Solved by B. B. in 11 mins

Leave a Comment