home.gif next.gif prev.gif



REPLACE

See also A-Z Spreadsheet Function List


Description Replaces part of a text string with another text string.

Syntax REPLACE(orig_text, start_position, num_chars, repl_text)

orig_text is the original text string.

start_position is the character position where the replacement begins.

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

bullet.gif If start_position is less than 1, #VALUE! is returned.

num_chars is the number of characters to replace. If this argument is negative, #VALUE! is returned.

repl_text is the replacement text string.

See Also MID , SEARCH , and TRIM functions

Examples REPLACE(“For the year: 1993”, 18, 1, “4”) returns “For the year: 1994”