REPLACE function

REPLACE replaces part of a text string with a different text string. This function can be used to replace both characters and numbers, which are automatically converted to text. The result of the function is always displayed as text.

Any text containing numbers must be enclosed in double quotation marks if you do not want it to be interpreted as a number.

Syntax

REPLACE(text, position, length, new text)

  • text is text of which a part is replaced.
  • position is the position within the text where the replacement begins.
  • length is the number of characters in text to be replaced.
  • new text is the text that replaces text.

Example

=REPLACE("1234567",1,1,"444") returns "444234567". One character at position 1 is replaced by the complete new text.