ReferenceFunctionsText Functions
REPLACE
Replaces part of a text string by position.
Summary
REPLACE(old_text, start_num, num_chars, new_text) works by character index.
Remarks
start_numis 1-based and must be at least1.num_charsmust be non-negative.- If start is beyond the end, the original text is returned unchanged.
- Non-text inputs are coerced to text.
Examples
Replace middle segment
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
abZZef
Insert at start
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
Q1-report
Related functions
FAQ
Does REPLACE match text patterns?
No. REPLACE is position-based and replaces by start_num and num_chars, not by searching old text.
Runtime metadata
Category
Text
Signature
REPLACE(arg1, arg2, ... argN: Any)This function accepts a repeating argument pattern (min args: 4).
Arity
min 4, max 1
Arguments
arg1Any · Scalar
Caps
PURE
Source