← Back to Blog

Excel Formula to Extract Domain from Email Address

Extracting the domain part from email addresses is a common data preparation task in marketing and CRM work. Excel makes it easy with text functions.

Basic Formula: Extract Domain After @

=RIGHT(A2, LEN(A2)-FIND("@",A2))

Example: "john@example.com" → "example.com"

Excel 365: TEXTAFTER (Cleanest Method)

=TEXTAFTER(A2,"@")

Extracts everything after the @ symbol. Simple and readable.

Extract Domain Without TLD (e.g., "example" from "example.com")

=MID(A2, FIND("@",A2)+1, FIND(".",A2,FIND("@",A2))-FIND("@",A2)-1)

Gets the text between @ and the next dot.

Handle Missing @ Symbol

=IFERROR(RIGHT(A2, LEN(A2)-FIND("@",A2)), "Invalid email")

Extract for Multiple Emails (Array Use)

These formulas work for an entire column — just drag down from the first cell.

Count Emails by Domain

Once you've extracted domains, use COUNTIF:

=COUNTIF($B:$B, "gmail.com")

FAQ

How do I extract the domain from an email in Excel?

=RIGHT(A2, LEN(A2)-FIND("@",A2)) returns "example.com" from "user@example.com".

What Excel version has TEXTAFTER?

TEXTAFTER is available in Excel 365 (Microsoft 365 subscription) and Excel 2024.

How can I remove duplicate domains after extracting them?

Use our Remove Duplicates Tool or Data → Remove Duplicates in Excel.

Related: Extract Text Between Characters and Extract Last Name from Full Name.