To extract the name from an email address, you can use a formula based on the TEXTBEFORE function. In the example shown, the formula in D5 is:


As the formula is copied down the table, it extracts the name from each email address as shown.

Notes: (1) TEXTBEFORE is a newer function in Excel. In older versions of Excel, you can use a formula based on the LEFT function as explained below. (2) All emails shown in the worksheet are fictional.

Generic formula



In this example, the goal is to extract the name from a list of email addresses. In the current version of Excel, the easiest way to do this is with the TEXTBEFORE function or the TEXTSPLIT function. In older versions of Excel, you can use a formula based on the LEFT and FIND functions. All three options are explained below.


The TEXTBEFORE function returns the text that occurs before a given delimiter. The generic syntax for TEXTBEFORE supports many options:


However, most of these arguments are optional. For this problem, we only need to provide the first two arguments, text and delimiter:


Text is the text string to split, and delimiter is the location at which to split the string. Since all email addresses contain the "@" character separating the name from the domain, we can extract the name with a formula like this:


As the formula is copied down the column, it extracts the name from each of the emails as shown in the worksheet. For more details on TEXTBEFORE, see How to use the TEXTBEFORE function.

Note: You can use the TEXTAFTER function to extract the domain from the email.

TEXTSPLIT function

Another easy way to solve this problem is with the TEXTSPLIT function, which is designed to split a text string at a given delimiter and return all parts of the split string in a single step. To solve this problem with TEXTSPLIT, use a formula like this in cell D5:


As the formula is copied down, TEXTSPLIT will split the email at the @ character and return the name and the domain. These two values will spill into column D and column E as seen below:

Using TEXTSPLIT to get name and domain from an email address

The advantage of this approach is that you get both the email and the domain with a single formula. For more details on TEXTSPLIT, see How to use the TEXTSPLIT function.

Legacy Excel

In older versions of Excel that do not provide the TEXTBEFORE  or TEXTSPLIT functions, you can use a formula based on the LEFT and FIND functions:


At the core, this formula extracts characters from the left with the LEFT function, using FIND to figure out how many characters to extract. C5 contains the email "", so FIND returns 12, since the "@" occurs as the 12th character. We then subtract 1 to prevent the formula from extracting the "@" along with the name:

FIND("@",C5)-1 // returns 11

The result is 11, which is returned directly to the LEFT function as the num_chars argument:

=LEFT(C5,11) // returns "john.doe123"

The final result returned by LEFT is "john.doe123". As the formula is copied down the column, it performs the same operation on each email address. Although this formula is more complicated than the TEXTBEFORE or TEXTSPLIT options above, it achieves the same result.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.