Column A has emails like ana@contoso.com. Return contoso.com
公式
=TEXTAFTER(A2, "@")
说明
The domain is everything after @. TEXTAFTER does that in one step. Older Excel uses MID and FIND.
步骤
- Find the @ character.
- Take every character after it.
- TRIM if the source data has stray spaces.
变体
Excel 2016
255 is long enough for any practical domain.
=MID(A2, FIND("@", A2)+1, 255)
Local part (before @)
Useful for username columns.
=TEXTBEFORE(A2, "@")
Registrable domain without subdomain
Still includes subdomains. Split on "." if you need the last two labels only.
=TEXTAFTER(A2, "@", -1)