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.

步骤

  1. Find the @ character.
  2. Take every character after it.
  3. 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)