How to Extract a Name From an Email Address in Excel
By ExcelReady TeamUpdated 7 min read
The short answer
To extract a name from an email address in Excel, take the text before the @, replace the dots with spaces and fix the capitals. For priya.sharma@example.com in A2, =PROPER(SUBSTITUTE(LEFT(A2,FIND("@",A2)-1),"."," ")) returns Priya Sharma. In Microsoft 365 or Excel 2024, TEXTBEFORE(A2,"@") can replace the LEFT and FIND part.
Key takeaways
- The name lives in the username, the part before the @: LEFT(A2,FIND("@",A2)-1) or TEXTBEFORE(A2,"@").
- SUBSTITUTE swaps the dots (or underscores) for spaces, and PROPER capitalises each word.
- For the first name, take the text before the first dot; for the last name, the text after the last dot.
- Emails like jdoe@ or initials can't be split reliably by any formula, so check those rows by hand.
On this page+
To extract a name from an email address in Excel, you take the part before the @ sign, turn the dots into spaces and fix the capital letters. One formula does all three steps, so priya.sharma@example.com becomes Priya Sharma. This guide shows the formula for every Excel version, how to get the first or last name on its own, and what to do with emails that don't contain a clear name.
How names sit inside an email address#
An email address has two parts: the username before the @ and the domain after it. When a company builds addresses from names, the name is in the username, usually with a separator between the parts:
| Username | Separator | |
|---|---|---|
priya.sharma@example.com | priya.sharma | dot |
tom_baker@example.org | tom_baker | underscore |
lena.m.fischer@example.com | lena.m.fischer | two dots (middle initial) |
jdoe@example.com | jdoe | none |
The formulas below find the @, keep what comes before it and split it at the separator. They return text, so the results update whenever an email in column A changes. If you need the part after the @ instead, see how to extract the domain from an email.
Step 1: Get the username before the @#
FIND returns the position of a character, and LEFT keeps that many characters from the start. For priya.sharma@example.com in A2:
=LEFT(A2,FIND("@",A2)-1)FIND("@",A2) returns 13, because the @ is the 13th character. Minus 1 gives 12, so LEFT keeps the first 12 characters: priya.sharma. This works in every version of Excel. The guides to LEFT and FIND explain each function on its own.
In Microsoft 365 or Excel 2024, TEXTBEFORE does the same in one step:
=TEXTBEFORE(A2,"@")Step 2: Turn the username into a full name#
SUBSTITUTE replaces one piece of text with another, and PROPER capitalises the first letter of each word. Put them around the username formula:
=PROPER(SUBSTITUTE(LEFT(A2,FIND("@",A2)-1),"."," "))Read it from the inside out:
LEFT(A2,FIND("@",A2)-1)returns priya.sharma.SUBSTITUTE(...,"."," ")replaces every dot with a space: priya sharma.PROPER(...)capitalises each word: Priya Sharma.
Fill it down (Windows: Ctrl+D; Mac: ⌘D). OMAR.HASSAN@example.com becomes Omar Hassan, because PROPER also lowers the other letters. lena.m.fischer@example.com becomes Lena M Fischer. The SUBSTITUTE function guide covers its optional fourth argument, which replaces only one occurrence.
The Microsoft 365 version is shorter:
=PROPER(SUBSTITUTE(TEXTBEFORE(A2,"@"),"."," "))Step 3: Extract only the first name#
The first name is the text before the first dot of the username. Put the username in a helper column, B2, with one of the Step 1 formulas, then in C2:
=PROPER(LEFT(B2,FIND(".",B2&".")-1))This returns Priya. The B2&"." part adds a dot to the end of the username before searching. If the username has no dot, as in jdoe, FIND still finds that added dot, and the formula returns the whole username instead of a #VALUE! error.
In Microsoft 365 or Excel 2024, use TEXTBEFORE with its last argument, if_not_found, set to the username:
=PROPER(TEXTBEFORE(B2,".",,,,B2))Don't search for the first dot in the full email address. In jdoe@example.com the first dot is in the domain, so you'd get jdoe@example. Always cut the domain off first. The same "text before the first separator" idea is covered in how to extract the first word.
Step 4: Extract only the last name#
The last name is the text after the last dot, which matters when there is a middle initial. In Microsoft 365 or Excel 2024, a negative instance number counts from the end:
=PROPER(TEXTAFTER(B2,".",-1,,,B2))For lena.m.fischer this returns Fischer. The final B2 returns the username when there is no dot.
In older versions, this classic formula gets the last part:
=PROPER(TRIM(RIGHT(SUBSTITUTE(B2,".",REPT(" ",100)),100)))SUBSTITUTE replaces each dot with 100 spaces, RIGHT keeps the last 100 characters (spaces plus the last name) and TRIM removes the spaces. The result is also Fischer. To split a full name you've already built, see how to split a full name into first and last.
Handle underscores, hyphens and numbers#
Nest one SUBSTITUTE inside another to handle more than one separator. This turns both dots and underscores into spaces:
=PROPER(SUBSTITUTE(SUBSTITUTE(TEXTBEFORE(A2,"@"),"."," "),"_"," "))tom_baker@example.org becomes Tom Baker. Leave hyphens alone: they are usually part of a name, and PROPER capitalises after them, so anne-marie.dubois becomes Anne-Marie Dubois.
Numbers, as in sam.lee82, stay in the result as Sam Lee82. Remove them in a separate step; the guide to extracting numbers from text shows how to work with digits mixed into text.
When a formula can't find the name#
Some addresses don't contain a clear name, and no formula can fix that:
- Initials and joined names such as jdoe or jsmith: Excel can't tell where the first name ends.
- Role addresses such as info@ or sales@: there is no person's name.
- Name rules PROPER doesn't know: mcdonald becomes Mcdonald, not McDonald.
Add a check column that flags usernames with no separator, for example =IF(ISNUMBER(FIND(".",B2)),"OK","Check"), then filter it to Check and review those rows by hand. Flash Fill is useful for a small, messy list: type the first name the way you want it, then press Ctrl+E on Windows or choose Data > Flash Fill on a Mac. Flash Fill results are fixed text, so they don't update when the email changes.
Imported lists often have extra spaces or mixed capitals. Clean the email column first with =LOWER(TRIM(A2)), so FIND works on tidy text. Going the other way, from names to addresses, is covered in how to create an email address from a name.
Practise it#
Try the exercise on this page: one formula turns an email into a full name. Then practise LEFT, RIGHT, MID and LEN in a live spreadsheet, practise TEXTBEFORE and TEXTAFTER for the shorter Microsoft 365 formulas, and clean messy text with TRIM, PROPER and SUBSTITUTE. Each lesson checks your formula as soon as you press Enter.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Turn the email in A2 into a name. Click B2, take the text before the @ with LEFT and FIND, replace the dot with a space using SUBSTITUTE, and wrap it all in PROPER. Press Enter.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | |||
| 2 | priya.sharma@example.com | |||
| 3 | omar.hassan@example.com | |||
| 4 | lena.fischer@example.org | |||
| 5 | tom.baker@example.com | |||
| 6 | ||||
| 7 | ||||
| 8 |
Tip: Work from the inside out: FIND("@",A2)-1 is the username length, LEFT takes it, SUBSTITUTE swaps "." for " ", and PROPER fixes the capitals.
Practise this in a lesson
Frequently asked questions
How do I get the first name from an email address in Excel?
Take the username, then the text before its first dot. With the username in B2, =PROPER(LEFT(B2,FIND(".",B2&".")-1)) returns Priya from priya.sharma. Adding a dot to the end stops FIND failing when there is no dot.
How do I extract everything before the @ in Excel?
Use =LEFT(A2,FIND("@",A2)-1), which works in every version. In Microsoft 365 or Excel 2024, =TEXTBEFORE(A2,"@") does the same thing in a shorter formula.
Can Flash Fill extract names from emails?
Yes. Type the name for the first email in the next column, then press Ctrl+E on Windows or use Data > Flash Fill on a Mac. The results are fixed text and don't update, so check them.
Why does PROPER give Mcdonald instead of McDonald?
PROPER capitalises only the first letter of each word and any letter after a non-letter character. It doesn't know name rules such as Mc or van, so fix those few cells by hand.