ReferenceFunctionsText Functions
TEXTBEFORE
TEXTBEFORE: Returns text that appears before a delimiter.
Summary
Returns text that appears before a delimiter.
Remarks
- Delimiter matching is case-sensitive.
instance_numdefaults to1; negative instances search from the end.instance_num=0or empty delimiter returns#VALUE!.- If requested delimiter occurrence is not found, returns
#N/A.
Examples
Text before first delimiter
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
a
Text before last delimiter
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
a-b
Related functions
FAQ
What happens when the delimiter is missing?
TEXTBEFORE returns #N/A when the requested delimiter occurrence is not found.
Runtime metadata
Category
Text
Signature
TEXTBEFORE(arg1: Any, arg2: Any, arg3?: Number)Arity
min 2, max 3
Arguments
arg1Any · Scalar
arg2Any · Scalar
arg3optionaldefaultNumber · Scalar · coercion NumberLenientText
Caps
PURE
Source