TEXTBEFORE Function in Zoho Sheet: Syntax, Examples and Troubleshooting
Extract text before a delimiter in Zoho Sheet, using occurrence numbers, case matching, a missing-match fallback and reproducible examples.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =TEXTBEFORE("North-Widget-0042";"-") returns North. By default, the function uses the first occurrence of the delimiter and a case-sensitive search. The delimiter itself is excluded from the result.
Availability and version history
- Introduced: Added in March 2023, according to Zoho’s release history; no numbered cloud release is given.
- Availability: Currently documented in Zoho Sheet’s rolling web-service help; no retirement or final supported release is identified in the checked sources.
- Scope: The web documentation establishes these options; mobile and imported-workbook behavior are not separately certified here.
- Checked: October 14, 2026, using the official TEXTBEFORE reference, with independent string-result checks. No native Zoho Sheet test.
Syntax and defaults
=TEXTBEFORE(text; delimiter; [instance]; [mode]; [match_end]; [if_not_found])
| Argument | Role | Required or default |
|---|---|---|
text |
Original text or a cell containing it | Required |
delimiter |
Literal text marking the boundary | Required |
instance |
Which occurrence to use; a negative integer counts from the end | Default 1 |
mode |
0 for case-sensitive matching; 1 to ignore letter case | Default 0 |
match_end |
1 treats the end of the text as a delimiter; 0 does not | Default 0 |
if_not_found |
Text returned when no valid match exists | Default is a not-found error |
The bracket notation marks optional arguments; do not type the brackets. These examples follow Zoho’s semicolon-separated syntax. A quoted delimiter such as "::" is a text boundary, not a character-count argument. The official reference documents the defaults and search direction.
Reproducible worksheet
Create headers in A1:G1: Input, Delimiter, Instance, Mode, Fallback, Result, Check. Enter the following text and numeric values in A2:E9. Type cell text without enclosing quote characters; quotation marks are needed for text literals written directly inside formulas.
| Row | A: Input text | B: Delimiter | C: Instance | D: Mode | E: Fallback | Expected F |
|---|---|---|---|---|---|---|
| 2 | North-Widget-0042 |
- |
1 | 0 | Review |
North |
| 3 | North-Widget-0042 |
- |
2 | 0 | Review |
North-Widget |
| 4 | North-Widget-0042 |
- |
-1 | 0 | Review |
North-Widget |
| 5 | Red|Blue|Green |
| |
-2 | 0 | Review |
Red |
| 6 | RedENDGreen |
end |
1 | 0 | No match |
No match |
| 7 | RedENDGreen |
end |
1 | 1 | No match |
Red |
| 8 | plain |
| |
1 | 0 | Review |
Review |
| 9 | tag::value |
:: |
1 | 0 | Review |
tag |
In F2, enter =TEXTBEFORE(A2;B2;C2;D2;0;E2) and fill down to F9. Explicit match_end=0 ensures that a genuinely missing delimiter uses the fallback. The first two rows differ only in occurrence number; rows 6 and 7 differ only in case-matching mode.
In G2, enter =TEXTBEFORE(A2;B2). Its expected result is North, matching F2 because the optional defaults are the same in this case. The full-column formula keeps the fallback explicit so unstructured rows remain visible for review rather than disappearing into blank-looking results.
Search direction and fallback choices
An instance of -1 selects the last delimiter; -2 selects the second-last. The returned string retains its original reading order. It is not reversed. This is useful when the last separator identifies a suffix but earlier separators are legitimate parts of the name.
For a missing delimiter, =TEXTBEFORE("plain";"|";1;0;0;"Review") returns the fallback Review under the documented no-match rule. A fallback does not repair the record. Keep it distinctive enough to find and investigate, especially before grouping or joining data.
match_end=1 changes the boundary rule and can therefore prevent a missing literal separator from producing your fallback. The worked data leave it at zero. The short help does not fully specify its interaction with negative occurrence numbers, empty delimiters or overlapping matches; those combinations are outside these examples.
Advanced example: separate a filename from its final extension
Keep the first table unchanged. Type budget.final.xlsx in A12. In B12, enter =TEXTBEFORE(A12;".";-1). The expected result is budget.final, because the last dot is the selected boundary. Using the default first occurrence would instead produce budget, losing a meaningful part of the filename.
In C12, enter =TEXTAFTER(A12;".";-1); expect xlsx. That companion function is documented in Zoho’s TEXTAFTER reference. In D12, enter =B12&"."&C12; expect budget.final.xlsx. Reconstructing the original string is a useful check that the chosen delimiter split the record where you intended.
For labels that contain padding, put East :active in A14, including two leading spaces and one space before the colon. In B14, enter =TRIM(TEXTBEFORE(A14;":")); expect East. TRIM changes whitespace deliberately; the extraction itself is not a promise to remove spaces.
Errors and troubleshooting
- No valid match: check spelling, delimiter and mode before replacing the error with a fallback. Zoho’s page writes
#N/Ain the argument description and#N/A!in its error table; the precise displayed spelling has not been observed here. - Wrong occurrence: count delimiter occurrences, not letters in the string. Start with a positive integer such as 1 or 2, or -1 for the final occurrence.
- Text treated as a name: put literal text inside double quotes when writing it directly in a formula; cell references such as A2 are not quoted.
- Invalid reference or input type: Zoho lists
#REF!for broken references and#VALUE!for unsuitable types. A broad IFERROR wrapper can hide these different causes; the function’s own fallback is more targeted to a missing match.
The TEXTBEFORE page specifically lists instance 0 or an instance greater than the text length under #VALUE!, and an occurrence beyond the available matches under the not-found error. Use well-defined integer occurrences; fractional-instance coercion is not established.