Skip to main content
← All functions

TEXTBEFORE function

Returns text that occurs before a given character or string

Syntax

TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
textYesThe text you are searching within. Wildcard characters not allowed."Red riding hood’s, red hood"
delimiterYesThe text that marks the point after which you want to extract."hood"
instance_numNoThe instance of the delimiter after which you want to extract the text.1
match_modeNoDetermines whether the text search is case-sensitive. The default is case-sensitive.1
match_endNoTreats the end of text as a delimiter. By default, the text is an exact match.0
if_not_foundNoValue returned if no match is found. By default, #N/A is returned."not found"

Try TEXTBEFORE

Extract the part before a delimiter

=TEXTBEFORE("ID-482","-")

Extract the part before a delimiter. The result is checked against a separately authored expected value for the supplied table. You can edit the data to explore the rule.

Inspect the current formula

Read its written arguments or observe actual operation values in a separate local calculation. This action neither applies a draft nor grades an answer.

Read the formula, one argument at a time

Explore the written function calls and their inputs. The calculation result belongs to the complete formula.

TEXTBEFORE · top-level call

=TEXTBEFORE("ID-482","-")

1 / 2 · text

The text you are searching within. Wildcard characters not allowed.

TEXTBEFORE reference ↗

Follow the cells behind a result

Read explicit local references and helper formulas using a separate calculation. Your draft stays in this field; the worksheet and practice checks do not change.

The worksheet runs locally. Published checks apply to the supplied example only. Native Excel and Google Sheets compatibility remain unverified.

Practice a complete task

Reference and compatibility

Univer 1.0.4 / Apache-2.0. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.