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 referenceHow To Use the new Excel TEXTBEFORE & TEXTAFTER Functions to Save Time on Your Next Project
Practice TEXTBEFORE
Extract the warehouse prefix before the first hyphen.
| A | B | |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 |
Show example formula
=TEXTBEFORE(B2,B3) Lesson quiz
Answer three questions to see your level in this lesson.
