The TEXTBEFORE function in Excel provides a straightforward way to extract specific portions of text that appear before a delimiter. This function, available in Excel 365 and Excel 2025, simplifies text parsing and data manipulation tasks that previously required complex formulas. Let’s explore how to use this function effectively and see practical examples of its applications.
How to Use the TEXTBEFORE Function in Excel
The TEXTBEFORE function follows a simple syntax but offers powerful text extraction capabilities. Here’s how to implement it in your spreadsheets:
- Open your Excel spreadsheet
- Select the cell where you want the extracted text to appear
- Type the formula using this syntax:
Copy
=TEXTBEFORE(text, delimiter) - Replace ‘text’ with your cell reference
- Specify your delimiter (the character where you want the text to stop)
Example:
Original Text |
Formula |
Result |
---|---|---|
John Smith |
=TEXTBEFORE(A1, ” “) |
John |
sales@company.com |
=TEXTBEFORE(A2, “@”) |
sales |

Extract Text Before a Comma
Working with comma-separated values is one of the most common use cases for TEXTBEFORE. Here’s how to handle different scenarios:
- Basic comma separation:
Copy
=TEXTBEFORE(A1, “,”)
Example table:
Address |
Formula |
Result |
---|---|---|
New York, NY 10001 |
=TEXTBEFORE(A1, “,”) |
New York |
Chicago, IL, 60601 |
=TEXTBEFORE(A1, “,”) |
Chicago |

Tips for handling multiple commas:
- The function always stops at the first occurrence of the delimiter
- Use nested functions for more complex extractions
- Consider trimming results to remove unwanted spaces
Working with Custom Delimiters
TEXTBEFORE supports various delimiter types:
- Space delimiter:
Copy
=TEXTBEFORE(A1, ” “)
- Special characters:
Copy
=TEXTBEFORE(A1, “-“)
Example table:
Original Text |
Delimiter |
Formula |
Result |
---|---|---|---|
PRD-1234-ABC |
“-“ |
=TEXTBEFORE(A1, “-“) |
PRD |
User#Admin#System |
“#” |
=TEXTBEFORE(A1, “#”) |
User |

Common TEXTBEFORE Applications
Here are practical scenarios where TEXTBEFORE proves invaluable:
- Email Processing:
Copy
=TEXTBEFORE(A1, “@”)

- Name Extraction:
Copy
=TEXTBEFORE(A1, ” “)
Example Applications Table:
Use Case |
Input |
Formula |
Output |
---|---|---|---|
Email Username |
john.doe@example.com |
=TEXTBEFORE(A1, “@”) |
john.doe ![]()
Try the Free Spreadsheet Extension Over 500,000 Pros Are Raving About
Stop exporting data manually. Sync data from your business systems into Google Sheets or Excel with Coefficient and set it on a refresh schedule. Get Started![]() |
First Name |
John Smith |
=TEXTBEFORE(A1, ” “) |
John |
Product Code |
ABC123-Description |
=TEXTBEFORE(A1, “-“) |
ABC123 |

Combining TEXTBEFORE with Other Functions
Enhance TEXTBEFORE’s capabilities by combining it with other Excel functions:
- With TRIM:
Copy
=TRIM(TEXTBEFORE(A1, “,”))

- With SUBSTITUTE:
Copy
=TEXTBEFORE(SUBSTITUTE(A1, “.”, “,”), “,”)

What Makes TEXTBEFORE Different from Other Text Functions
Comparing TEXTBEFORE with traditional text functions:
Feature |
TEXTBEFORE |
LEFT |
MID |
---|---|---|---|
Delimiter Support |
Yes |
No |
No |
Dynamic Length |
Yes |
Fixed |
Fixed |
Ease of Use |
High |
Medium |
Low |
Flexibility |
High |
Limited |
Limited |
Next Steps with Text Manipulation
To maximize your text manipulation capabilities:
- Practice with different delimiter types
- Experiment with nested functions
- Test your formulas with varied data sets
- Ensure your Excel version supports TEXTBEFORE
Ready to take your Excel data handling to the next level? Coefficient helps you automate data workflows and enhance your spreadsheet capabilities. Get started with Coefficient to streamline your data processing tasks.