REPLACE(), REPLACEB()

Syntax

  • REPLACE(old_text,start_num,num_chars,new_text)

  • REPLACEB(old_text,start_num,num_bytes,new_text)

Definition. The REPLACE() function replaces the old_text string beginning at start_num and with the length indicated by num_chars with the new string in new_text.

Use REPLACEB() for double-byte characters.

Arguments

  • old_text (required). The string containing the characters you want to replace

  • start_num (required). The starting position for text replacement

  • num_char/num_bytes (required). The number of characters/bytes beyond the start position in which to make replacements

  • new_text (required). The text that will replace the characters in old_text

Background. Use this function to replace either specific characters or a specific string ...

Get Microsoft® Excel® 2010 Formulas & Functions Inside Out now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.