# How to extract the username from an email address in Excel

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

**Excel:** `=TEXTBEFORE(A2,"@")` (Microsoft 365 only)

**Google Sheets:** `=LEFT(A2,FIND("@",A2)-1)`

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Email | Username |
| lena.park@northwind.example |  |
| omar@contoso.example |  |
| p.shah@fabrikam.example |  |
| tom.becker+news@litware.example |  |
| ines@adatum.example |  |
| Raj.Patel@proseware.example |  |

Formula in B2, filled to B7: `=TEXTBEFORE(A2,"@")`

Result: lena.park; omar; p.shah; tom.becker+news; ines; Raj.Patel

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

## Other ways

- `=LEFT(A2,FIND("@",A2)-1)`: Works in every version of Excel and in Google Sheets.
- `=REGEXEXTRACT(A2,"^[^@]+")`: 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.

## 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,"@")`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/extract-username-from-email
