REPLACE

Description

Replaces part of a text string with another text string.

Syntax

REPLACE ( orig_text, start_position, num_chars, "repl_text" )

Parameter Description
orig_text The original text string.
start_position The character position where the replacement begins.

If start_position is greater than the number of characters in orig_text, repl_text is appended to the end of orig_text.

If start_position is less than 1, #VALUE! is returned.
num_chars The number of characters to replace. If this argument is negative, #VALUE! is returned.
repl_text The replacement text string.

Examples

This function returns "For the year: 2011":

REPLACE("For the year: 2014", 18, 1, "4")

See also

MID

SEARCH

TRIM