Returns the specified text where the characters at the specified position are replaced with another specified text.
Syntax
![]() |
---|
REPLACE( Text text, Integer start, Integer count, Text new ) → Text |
Returns text, but removes count characters starting at position start, and replaces the removed characters with new. The character positions in the text begin at 1.
If start or count are not integer, they are automatically truncated. If start is less than 1, the function returns the #VALUE! error value. If start is greater than the length of the text, the new text is appended at the end. If count goes beyond the end of the text, the function removes all characters from start until the end of the text.
Formula
![]() |
---|
=REPLACE("Mr. Brown is here",5,5,"O'Donel") |
Function Reference
LEFT Function
RIGHT Function
MID Function
SEARCH Function
SUBSTITUTE Function
TRIM Function