Excel Extract Domain From Email Formula
By Szabó Gergő · Updated
Everything after @ is the domain. TEXTAFTER is the short form; FIND and MID work in older Excel.
Syntax and arguments
=TEXTAFTER(TRIM(A2),"@")- A single address in a cell.
Domain from email examples
01
Microsoft 365
Email in A2.
=TEXTAFTER(TRIM(A2),"@")TRIM removes stray spaces from a CSV import.
02
Older Excel
Same cell.
=MID(A2,FIND("@",A2)+1,99)FIND locates @, MID takes the rest. 99 is enough for a domain.
03
Blank if missing @
Dirty list.
=IF(ISNUMBER(FIND("@",A2)),TEXTAFTER(TRIM(A2),"@"),"")Avoids #VALUE! on rows that are not emails.
Common mistakes
Using RIGHT with a fixed length
Domains vary. Split on @ instead.
Keeping angle brackets
If the cell is Name <a@b.com>, extract inside the brackets first.
Lowercasing only in the formula
=LOWER(TEXTAFTER(TRIM(A2),"@")) if you will match domains later.
Domain from email FAQ
Can I get the local part?
=TEXTBEFORE(A2,"@") or =LEFT(A2,FIND("@",A2)-1).
How do I count Gmail rows?
=COUNTIF(B2:B200,"gmail.com") after the domain column is filled.
Does this handle plus aliases?
The domain is still after @. user+tag@gmail.com returns gmail.com.