FormulaCraft

How to get the text before a character in Excel and Google Sheets

Topic:Text manipulation
Excel & Google Sheets
=LEFT(A2,FIND("@",A2)-1)

Verified example

Computed by a real spreadsheet engine on the sample data below.

EmailUsername
alice@example.com
bob@mail.com
carol@test.org
dan@work.io
eve@site.net

=LEFT(A2,FIND("@",A2)-1)alice

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1In the destination cell, enter =LEFT(A2,FIND("@",A2)-1) — replace "@" with your actual delimiter.
  2. 2FIND locates the character position; subtracting 1 excludes the delimiter itself from the result.
  3. 3In Excel 365, use the simpler =TEXTBEFORE(A2,"@") for the same result.
  4. 4Wrap in IFERROR to handle cells where the delimiter doesn't exist.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Is TEXTBEFORE available in Google Sheets?

As of 2024, TEXTBEFORE is not available in Google Sheets — use LEFT and FIND there.

What if the delimiter appears more than once?

FIND returns the position of the first occurrence. To target a later occurrence, use FIND's start_num argument to begin the search after the previous match.

More on Text manipulation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: