To pull the username out of an email address in Excel, use a formula built around LEFT and FIND: =LEFT(A2,FIND("@",A2)-1). That takes everything to the left of the @ symbol. If your data includes a domain part or trailing spaces, wrap it in TRIM first. The steps below cover that basic formula, a safer version that does not break on blank cells, and the variants for domains that appear in the middle of a string.
What You'll Need
- Excel (Microsoft 365, Excel 2021, 2019 or 2016). The formulas here also work in Excel Online and in Google Sheets.
- Your email addresses in a single column, one address per cell, with no line breaks inside a cell.
- A blank column next to the email column where the result can go, so the original data stays intact.
Step-by-Step
- Put the emails in one column. For this walk-through, assume the first address is in cell A2 and the list runs down column A starting at row 2 (row 1 holds a header such as "Email").
- Add a header in the result column. Click B1 and type
Username. Press Enter. Keeping a header makes the column easy to sort and filter later. - Enter the basic formula. Click B2 and type:
=LEFT(A2,FIND("@",A2)-1)
Press Enter. Forjane.smith@example.comthe cell returnsjane.smith. - Understand what each part does.
FIND("@",A2)returns the position of the @ symbol as a number. Subtracting 1 stops the formula just before it.LEFTthen returns that many characters from the start of the text. In the example above the @ is at position 11, so LEFT returns the first 10 characters. - Copy the formula down. Click B2, grab the small square handle at the bottom-right corner of the cell (the fill handle) and drag down to the last row, or double-click the fill handle to fill automatically as far as the neighbouring column has data. The row references update for each row.
- Handle blanks and missing @ signs. If a cell is empty or has no @ in it, the basic formula returns a
#VALUE!error. Use this version instead:=IFERROR(LEFT(A2,FIND("@",A2)-1),"")
It shows nothing when the formula cannot work, which keeps the sheet clean and easy to count. - Clean up stray spaces. Pasted data often carries a trailing space before the @, which produces a username ending in a space. Wrap the whole thing in
TRIM:=IFERROR(TRIM(LEFT(A2,FIND("@",A2)-1)),"") - Try the newer text functions (Microsoft 365). If your Excel version supports them, this is shorter and reads more naturally:
=IFERROR(TEXTBEFORE(A2,"@"),"")TEXTBEFOREreturns everything before the first @ and behaves the same way for this task. If Excel shows#NAME?, your version does not have it, so go back to theLEFTandFINDversion. - Convert results to plain text if you need to move them. The output is a formula, so copying and pasting it elsewhere will break if the source cells are gone. Select the column, copy it, then use Paste Special and choose Values. The usernames become fixed text. This is irreversible for those cells, so work on a copy if unsure.
- Check a few rows by eye. Pick five addresses with different shapes: one short username, one with dots, one with a plus sign (such as
name+tag@example.com), one with an underscore, and any that look malformed. Confirm the results match what you expect before relying on the column.
Common Mistakes
- Forgetting the -1. Without it, the username comes back with the @ stuck on the end, which then fails when you match it against other lists.
- Typing the email instead of referring to it. Writing
FIND("@","jane@example.com")hard-codes one result. Always point at the cell so the formula can be filled down. - Using SEARCH instead of FIND without knowing the difference. For the @ symbol the two behave identically. FIND is case-sensitive; SEARCH is not. That only matters if you switch to extracting a domain or a name where letter case matters.
- Overwriting the email column. Pasting results back over column A destroys the source data. Keep the formula in a separate column until you are certain the output is right.
- Assuming every address has exactly one @. Malformed entries with two @ symbols will return everything before the first one. That is usually acceptable, but check any rows that look odd.
- Copying formulas between workbooks without checking references. The copied formula still points at the original workbook. Use Paste Special > Values, or re-enter the formula in the new file.
Tips
- Name the result column "Username" rather than leaving a header blank, so later lookups like VLOOKUP or XLOOKUP read clearly.
- If you also want the domain, put
=IFERROR(REPLACE(A2,1,FIND("@",A2),""),"")in the next column. It replaces everything up to and including the @ with nothing. - To split the username on a dot as well, nest the formula: take the username column and apply
=IFERROR(LEFT(B2,FIND(".",B2)-1),B2), which returns the first name for dotted addresses and leaves the whole username for undotted ones. - For bulk work on thousands of rows, use Power Query instead of dragging formulas. Load the table, add a custom column with
Text.BeforeDelimiter([Email], "@"), and it stays repeatable each time the data refreshes. - Apply a conditional format to the result column to highlight any non-blank cells, which quickly reveals rows where the source email was malformed.
- Sort your source data before converting to values if you plan to keep both columns side by side, so the pairs stay aligned.
Troubleshooting
If the formula shows #VALUE!, the cell most likely has no @ symbol or is empty. Wrap it in IFERROR and inspect the source cell for a hidden leading apostrophe or a space that Excel turned into text.
If you see #NAME?, the function name has been misspelt or the version does not support the function. Check for typos first, then switch TEXTBEFORE for LEFT and FIND.
If every result is identical, the formula probably has absolute references (dollar signs) around the row, or calculation is set to manual. Go to the Formulas tab and confirm calculation options are set to automatic; the labels in the ribbon can differ slightly between versions, so look for Calculation Options in the Calculation group.
If the result has spaces around it, add TRIM. If it shows a leading quote mark, the source was pasted as text and the quote is part of the cell contents, which TRIM will not remove; re-paste the data using Paste Special > Text or clean it with Find and Replace.
If nothing appears after dragging, the cells may be formatted as text. Change the format to General, then press F2 and Enter on the first formula cell to force a recalculation, then fill again.
Frequently Asked Questions
Can I get the username when the email is not in its own cell but inside a sentence?
Not reliably with these formulas. Extract the address first with text functions or Power Query, then apply the formula to the clean address.
Does this work in Google Sheets?
Yes. LEFT, FIND and IFERROR behave the same way. Google Sheets also has SPLIT, which can break the address into username and domain in one step.
What if the username contains an @ symbol?
It cannot. Only the first @ is treated as the separator, so anything after it is treated as the domain. Addresses with two @ symbols are malformed and the formula will return whatever precedes the first one.
Can I do this without formulas?
Yes. Use Data > Text to Columns, choose Delimited, set @ as the delimiter, and the address splits into two columns at once. This also overwrites the adjacent column, so make sure the space is free first.
Why does the formula return a number instead of text?
It should not for a normal address. If it does, the cell likely contains only a number with an @ after it, which is unusual. Check the source data for a stray character.