How to Use TEXTBEFORE Formula in Excel + Tips
Learn how to use TEXTBEFORE function in Excel step-by-step to get text before specific delimiter, very easy and useful.
Hello everyone! Today i will show you how to use TEXTBEFORE formula in Excel step by step. TEXTBEFORE is available in Excel 2021 and Excel 365.
What is TEXTBEFORE Function in Excel?
The TEXTBEFORE function help you extract all text that appears before a specific character or delimiter (like space " ", dash -, at sign @, or comma ,). In old Excel, you need combine LEFT and FIND formulas together, but TEXTBEFORE make your formula very short and simple!
📚 Related Tutorial: Want to split text into multiple columns or rows instead? Check out How to Use TEXTSPLIT Function in Excel!
🛠️ Formula Syntax
=TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
text: The cell or original text string you want to extract from (example:A1).delimiter: The symbol or text character you look for (example:"@"," ","-").[instance_num](Optional): Which occurrence of delimiter to match (example:1for 1st dash,2for 2nd dash).[match_mode](Optional):0for case-sensitive match (default),1for case-insensitive match.[if_not_found](Optional): What text to show if delimiter is not found in cell.
📊 Simple Examples
Example 1: Extract First Name from Full Name
=TEXTBEFORE(A1, " ")
If cell A1 contains "John Smith", formula returns: John
Example 2: Extract Username from Email Address
=TEXTBEFORE(A1, "@")
If cell A1 contains "meng@gmail.com", formula returns: meng
Example 3: Extract Text Before Dash -
=TEXTBEFORE(A1, "-")
If cell A1 contains "John-Smith", formula returns: John
Example 4: Get Text Before 2nd Delimiter
=TEXTBEFORE(A1, "-", 2)
If cell A1 contains "2026-09-14", setting instance_num to 2 returns: 2026-09
Example 5: Avoid #N/A Error if Delimiter Missing
If delimiter might not exist in cell, use IFNA to return original cell A1 cleanly:
=IFNA(TEXTBEFORE(A1, "-"), A1)
⚡ Modern Excel Text Functions Comparison
| Function | Purpose | Example |
|---|---|---|
TEXTBEFORE | Get text before a specific delimiter | =TEXTBEFORE(A1, "@") |
TEXTAFTER | Get text after a specific delimiter | =TEXTAFTER(A1, "@") |
TEXTSPLIT | Split text into columns or rows by delimiter | =TEXTSPLIT(A1, ",") |
TEXTJOIN | Combine text from multiple cells with delimiter | =TEXTJOIN(", ", TRUE, A1:A5) |
💡 Quick Tips & Easy Memory Rule:
- Memory Rule:
TEXTBEFORE= Get everything BEFORE the delimiter.- Case Sensitivity:
TEXTBEFOREis case-sensitive by default! Searching"a"will not match"A". Setmatch_modeto1if you want case-insensitive search.
📚 Related Resources & Tutorials
Related Tutorials
Opens in new tab ↗How to Use TEXTAFTER Formula in Excel + Tips
Learn how to use TEXTAFTER function in Excel step-by-step to get text after specific delimiter, very easy and useful.
How to Use TEXTJOIN Formula in Excel (Video in Khmer) + Tips
Learn how to use TEXTJOIN function in Excel step-by-step to combine text from multiple cells with delimiters and skip blank cells easily.
How to Use REDUCE Function in Excel + Tips
Learn how to use REDUCE function in Excel step-by-step to swap or insert text based on position with simple examples.