The excel REPLACE function replaces the text based on a predetermined position.
Excel has another function to change a text, namely the excel SUBSTITUTE function. What’s the difference between the REPLACE function and the SUBSTITUTE function? Please read the following article:
REPLACE(old_text, start_num, num_chars, new_text)
old_text, required, the text in which you want to replace.
start_num, required, the starting position of the character to replace with the new_text.
num_chars, required, the number of characters to replace with the new_text.
Usage notes:
The following is an example of the REPLACE function usage and the results.
=REPLACE(A2,B2,C2,D2)
The REPLACE function replaces 2 characters in position 1 with characters “19”. The result is 19-0001
=REPLACE(A3,B3,C3,D3) =REPLACE(A4,B4,C4,D4) =REPLACE(A5,B5,C5,D5)
All functions return a #VALUE error. You can’t use negative numbers for the start_num and num_chars arguments. In addition to negative numbers, you can’t use zero number in the start_num argument.
=REPLACE(A6,B6,C6,D6)
If you use zero number for the num_chars argument the result is like adding new_text to old_text; no characters changed, where the new_text will be added depending on the value of the start_num argument.
=REPLACE(A7,B7,C7,D7)
If the start_num argument is greater than the text length, new_text will be added to the end of old_text. Regardless of the numbers entered in the num_chars argument, it does not affect the results.
Calculate Number of Days Between Two Dates Excel has a function that calculates the number of days between two dates,…
What is Flash Fill Excel Flash Fill automatically fills your data when Excel detects a pattern in your initial data…
What is Paste Special Paste special is a paste but you can choose the result type. As we all know,…
What is the Excel TEXTJOIN Function? The excel TEXTJOIN function is the best function to concatenate strings in Excel, has…
What is the Excel CONCAT Function? The excel CONCAT function combines all data; it could be a text, a number…
What is the Excel CONCATENATE Function? The excel CONCATENATE function combines text or numbers into a text. CONCATENATE Syntax CONCATENATE(text1,…