Excel TEXTBEFORE Function: Complete Guide to Extract Text Before Delimiters

Published: January 21, 2025 - 3 min read

Vijay Srinivas

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:

  1. Open your Excel spreadsheet
  2. Select the cell where you want the extracted text to appear
  3. Type the formula using this syntax:
    Copy
    =TEXTBEFORE(text, delimiter)
  4. Replace ‘text’ with your cell reference
  5. 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:

  1. 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:

  1. Space delimiter:

Copy

=TEXTBEFORE(A1, ” “)

  1. 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:

  1. Email Processing:

Copy

=TEXTBEFORE(A1, “@”)

  1. Name Extraction:

Copy

=TEXTBEFORE(A1, ” “)

Example Applications Table:

Use Case

Input

Formula

Output

Email Username

john.doe@example.com

=TEXTBEFORE(A1, “@”)

john.doe

Coefficient Excel Google Sheets Connectors
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:

  1. With TRIM:

Copy

=TRIM(TEXTBEFORE(A1, “,”))

  1. 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.

Sync Live Data into Your Spreadsheet

Connect Google Sheets or Excel to your business systems, import your data, and set it on a refresh schedule.

Try the Spreadsheet Automation Tool Over 500,000 Professionals are Raving About

Tired of spending endless hours manually pushing and pulling data into Google Sheets? Say goodbye to repetitive tasks and hello to efficiency with Coefficient, the leading spreadsheet automation tool trusted by over 350,000 professionals worldwide.

Sync data from your CRM, database, ads platforms, and more into Google Sheets in just a few clicks. Set it on a refresh schedule. And, use AI to write formulas and SQL, or build charts and pivots.

Vijay Srinivas GTM @ Coefficient
Vijay Srinivas is an engineer turned marketer who loves to dabble in data and has 6 years of experience in GTM for Startups and SaaS orgs. Building his skills currently to be a PLG & spreadsheet expert.
500,000+ happy users
Wait, there's more!
Connect any system to Google Sheets in just seconds.
Get Started Free

Trusted By Over 50,000 Companies