ReferenceFunctionsText Functions
MID
MID: Returns a substring starting at a 1-based position.
Summary
Returns a substring starting at a 1-based position.
Remarks
start_numis 1-based; values below1return#VALUE!.num_charsmust be non-negative; negatives return#VALUE!.- If start is beyond the end of the text, returns an empty string.
- Non-text inputs are coerced to text.
Examples
Extract middle segment
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
reads
Start past end returns empty
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
Related functions
FAQ
How does MID handle out-of-range start positions?
If start_num is beyond the text length, MID returns an empty string.
Runtime metadata
Category
Text
Signature
MID(arg1, arg2, ... argN: Any)This function accepts a repeating argument pattern (min args: 3).
Arity
min 3, max 1
Arguments
arg1Any · Scalar
Caps
PURE
Source