REPLACE function. Replace specified character position & number of characters with specified string.(Microsoft Excel)

Japanese version.

Replace specified character position & number of characters with specified string.

How it works

=REPLACE(Old_text,Start_num,Num_chars,New_text)
NameOmissionExplanation
Old_textRequired argument.Target Text.
Start_numRequired argument.Position to start replacement (first position is 1).
Num_charsRequired argument.The position at which the substitution will end. The number of characters from the Start_num.
If 0 is specified, the operation is only insertion without replacement.
If a number greater than a string is specified, all characters after the Start_num will be replaced.
New_textRequired argument.Replaced string.

Example Results

Enumerate the various cases.

  • Normal case.
  • The start position exceeds the number of strings.
  • The start position is 0.
  • The number of characters is 0.

Spill

If any argument is a cell range, the result of the function will be Spill.

Difference from REPLACE function

It is similar to the REPLACE function, which also replaces text, but differs in the selection of replacement locations.

FunctionReplacement location
SUBSTITUTEText.
REPLACEStart position and number of characters.

---

Links

Microsoft Excel Functions Text