Extract the domain from an email (MID + FIND)

Hard Text
Description
Hints 0/4
Solutions 2
–
Test case
1
2
3
Reset
Submit
fx
A
B
C
D
E
F
G
1
2
3
4
5
6
7
8
9
10
Loading interactive spreadsheet...
Preparing grid cells and formula calculation engine
○ Ready Enter formula in highlighted cells, then click Submit.

The problem

Problem statement

Marketing wants signups grouped by company domain, but the export only kept full addresses in A2. Pull everything after the @ into the Domain cell C2 — corp.com for [email protected].

Start one character past the @ and take everything that follows — case 2 has a two-part domain and case 3 has a plus-tagged mailbox, so the @ position and the length are both unknown.

Problem data

Show the sheet as a table (selectable, copyable)
The exercise data, as a table
AC
1EmailDomain
2[email protected]

Notes

FIND("@", A2) returns the position of the @, and MID needs the position of the first character you want — so add 1, otherwise the result starts with the @ itself. The length argument only has to be long enough; LEN(A2) is a safe over-estimate because MID stops at the end of the text.

How to approach

Your answer goes in C2. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.

  1. Target cell is C2
  2. FIND("@", A2) gives you where the @ sits
  3. MID starts at the character you name, so you need the position just after the @
  4. Shape: =MID(?, FIND("@", ?) + 1, ?)

Official solutions

Show 2 solutions — try it yourself first

Approach 1: MID from just after the @

=MID(A2,FIND("@",A2)+1,LEN(A2))

FIND locates the @, +1 moves to the next character, and LEN(A2) is a generous length — MID simply stops at the end of the string. No assumption about how long the domain is.

Approach 2: RIGHT with the leftover length

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

Everything after the @ is the total length minus the @ position. RIGHT reads it from the other end, which is easier to reason about when the prefix varies.

Function guide

Related practice

FAQ

How do I extract the text after a specific character?

Find the character with FIND, then take the rest with MID or RIGHT. The pattern =MID(A2, FIND("@", A2) + 1, LEN(A2)) works for any delimiter — swap the @ for a comma or a dash.

Why is there a +1 in FIND("@", A2) + 1?

FIND returns the position of the @ itself. MID starts at the character you give it, so without +1 the result would begin with the @ — `@corp.com` instead of `corp.com`.

Can I split on the dot instead?

Not reliably. Domains have different numbers of dots (.co.uk, .com.au) and the local part can contain dots too, as in anna.lee@ — the @ is the only dependable separator.