Syntax
=REPLACE(old_text, start_num, num_chars, new_text)Arguments
| Argument | Required | Description |
|---|---|---|
old_text | Required | The text to change |
start_num | Required | Position of the first character to replace |
num_chars | Required | How many characters to replace |
new_text | Required | The text to put in |
How to use REPLACE
REPLACE takes 4 required arguments. Type =REPLACE( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=REPLACE("abcdefghijk", 6, 5, "*")Result =REPLACE("2009", 3, 2, "10")Result Related text functions
- REGEXEXTRACTReturns the parts of a text that match a regular expression pattern.
- REGEXMATCHChecks whether any part of a text matches a regular expression pattern (case sensitive).
- REGEXREPLACEReplaces the parts of a text that match a regular expression pattern.
- REGEXTESTChecks whether any part of a text matches a regular expression pattern.
- REPLACEBSame as REPLACE, counting bytes; without a double byte language set as default each character counts as one byte.
- REPTRepeats text a given number of times.
- RIGHTReturns the last characters of a text.
- RIGHTBSame as RIGHT, counting bytes; without a double byte language set as default each character counts as one byte.
- SEARCHReturns the position of one text inside another, ignoring case. Accepts the wildcards ? and *.