Spreadsheet Practice

How to extract the username from an email address in Excel

Excel formula

=TEXTBEFORE(A2,"@")

Take the text before the @: =TEXTBEFORE(A2,"@") in Excel 365, or =LEFT(A2,FIND("@",A2)-1) in any version.

Result on the example
one result per row in B2, filled down to B7
Works in
Microsoft 365 only
Google Sheets
Different formula, see below

See it work

The formula is already in B2, filled down to B7. Change any input and the result updates, or edit the formula to experiment.

How it works

TEXTBEFORE returns everything before the first @. The classic version finds the @ with FIND and keeps one character less than its position with LEFT, so the @ itself is left out.

=TEXTBEFORE(A2,"@")

Result"lena.park"

  1. A2"lena.park@northwind.example"

    The value in A2.

  2. TEXTBEFORE(A2,"@")"lena.park"

    TEXTBEFORE: Text before a delimiter.

    • textA2"lena.park@northwind.example"
    • delimiter"@"

In Google Sheets

Google Sheets needs a different formula: =LEFT(A2,FIND("@",A2)-1). On the same data it gives the same result. Here it is running in Google Sheets mode.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=LEFT(A2,FIND("@",A2)-1)lena.park, omar, p.shah…Works in every version of Excel and in Google Sheets.
=REGEXEXTRACT(A2,"^[^@]+")Google Sheetslena.park, omar, p.shah…Google Sheets: the run of characters that aren't @ at the start of the text.

Common mistakes

  • Plus-address tags stay in: "tom.becker+news". Cut them off with =TEXTBEFORE(TEXTBEFORE(A2,"@"),"+",,,,TEXTBEFORE(A2,"@")).
  • A cell without an @ returns #N/A (#VALUE! with FIND). Wrap the formula in IFERROR(…,"") to leave those blank.
  • Usernames keep their capitals. Use =LOWER(TEXTBEFORE(A2,"@")) before comparing or removing duplicates.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Extract the username from an email address

In B2, extract the username (everything before the @) from the email address and fill down to B7.

Questions

How do I turn "lena.park" into "Lena Park"?

Replace the dot with a space and capitalize: =PROPER(SUBSTITUTE(TEXTBEFORE(A2,"@"),"."," ")).

How do I get the domain instead?

Take the text after the @: =TEXTAFTER(A2,"@").

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.