
TextLevel: IntermediateAvailable in: Excel 365 / 2021+
In this article
- Syntax
- Examples
- Example 1
- Example 2
- Example 3
- Related functions
TEXTBEFORE returns everything before a delimiter; TEXTAFTER everything after. They replace most LEFT/FIND and MID/FIND combinations.
Syntax
=TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
| Argument |
What it means |
instance_num |
Which occurrence; negative counts from the end. |
if_not_found |
Result when the delimiter is missing. |
Examples
Example 1
=TEXTBEFORE(A2, "@")
Username from an email.
Example 2
=TEXTBEFORE(A2, " ", -1)
Everything except the last word.
Example 3
=TEXTBEFORE(A2, "-", , , , A2)
Whole text if there is no dash.
TEXTAFTER · TEXTSPLIT · LEFT
📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.
✨ Ask AI about this articleStuck on a step? Ask a question and the AI answers using this article.
Free · AI can be wrong