TextExcel 2024

TEXTBEFORE

Extract everything before a chosen occurrence of a delimiter.

Syntax

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

Worked example

Extract the warehouse prefix before the first hyphen.

=TEXTBEFORE("WH-704","-")

Result WH

Microsoft documentation

Check the arguments, supported editions and behavior of this function in Microsoft’s reference.

Microsoft reference

Search ExcelTutor