Function Problems

Excel Formula to Extract Text Between a Period and @

John WilsonJohn Wilson Nov 18, 2026 869 views

Question details

Extract a variable-length last name or other text between a period and the @ symbol in an email address using a dynamic formula.

Product
Microsoft Excel
Device & OS
not provided
Scenario
Email addresses are stored in a worksheet column, and the user wants to extract the name portion before the @ symbol.
Observed behavior
The extracted text should update automatically when the source address changes, including when names have different lengths.
Before you start

Check which column contains the email addresses and whether the part before @ can contain multiple periods. The examples below assume the first address is in cell A2.

Solution 1Recommended

Extract text after the first period with MID and FIND

Use this formula when the part of each email address before @ contains one period.

1
Enter the formula

Select an empty cell such as B2 and enter =IFERROR(MID(A2,FIND(".",A2)+1,FIND("@",A2)-FIND(".",A2)-1),"").

2
Fill the column

Press Enter, then drag the fill handle from B2 down alongside the remaining email addresses.

Missing or multiple periods: The formula returns a blank if it cannot extract text between a period and @. If there are multiple periods before @, it returns everything after the first period.
Extract email text in WPS Spreadsheets

Extract Last Names with a Formula in WPS Spreadsheets

Use MID and FIND in WPS Spreadsheets to extract text between the first period and @. The result updates when the email address changes.

  1. 1. Open the worksheet: Open your Excel workbook in WPS Spreadsheets and locate the email addresses in column A.
  2. 2. Enter the formula: Select B2 and enter =IFERROR(MID(A2,FIND(".",A2)+1,FIND("@",A2)-FIND(".",A2)-1),"").
  3. 3. Fill the remaining rows: Press Enter, then drag the fill handle from B2 down to extract text from the other addresses.
  4. 4. Save the workbook: Choose File > Save As and select an Excel format such as XLSX if you need to share the workbook with Excel users.
Extract variable-length names with a dynamic formulaOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interfaceGet started with WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Will the extracted name update if the email address changes?

Yes. A formula in B2 that references A2 recalculates when A2 changes, provided workbook calculation is enabled.

What happens if an address has no period before @?

The IFERROR formulas above return a blank. Without IFERROR, FIND or TEXTAFTER can return an error when the delimiter is missing.

How do I extract only the text after the last period?

In a supported version of Excel, enter =IFERROR(TEXTAFTER(TEXTBEFORE(A2,"@"),".",-1),"") in an empty cell. The -1 argument selects the last period before @.

Can I use Flash Fill instead of a formula?

You can enter an example result and choose Data > Flash Fill, but Flash Fill is not dynamic and may not handle addresses without last names consistently.