Using the Excel REPLACE Function
SummaryThe Excel REPLACE function will replace a portion of a text string, based on the number of characters specified, with a new text string.
REPLACEB performs the same function, but the portion of text replaced is based on the number of specified bytes.
Use REPLACE when working with single-byte character sets (SBCS) and REPLACEB when working with double-byte character sets (DBCS). Languages that support DBCS include Japanese, Chinese (Simplified and Traditional), and Korean.
Syntax=REPLACE (old_text, start_num, num_chars, new_text)
=REPLACEB (old_text, start_num, num_bytes, new_text)
Syntax BreakdownOld Text
Required. Existing text in which you want to replace one or more characters.
Required. Position of the character in old_text that will be replaced with new_text. The first character in the string is considered position 1.
Required. Number of characters in old_text that will be replaced with new_text.
Required if using REPLACEB. Number of bytes in old_text that will be replaced with new_text.
Required. The text that will replace old_text.