Spreadsheet Practice

How to check if an email address is valid in Google Sheets

Google Sheets formula

=REGEXMATCH(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$")

Test the shape with REGEXMATCH: =REGEXMATCH(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$") returns TRUE for something@domain.tld.

Result on the example
one result per row in B2, filled down to B7
Excel
See below

See it work

The formula is already in B2, filled down to B7. Change any input and the result updates, or edit the formula to experiment.

How it works

The pattern reads from start (^) to end ($): one or more characters that aren't @ or a space, a single @, more of the same, a dot, and two or more letters. "raj@contoso" fails for having no ending, "lee chen@" for the space, and "kim@@" for the second @.

=REGEXMATCH(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$")

ResultTRUE

  1. A2"ana.ruiz@northwind.com"

    The value in A2.

  2. REGEXMATCH(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$")TRUE

    REGEXMATCH: TRUE if the text contains a match for the pattern.

    • textA2"ana.ruiz@northwind.com"
    • regular_expression"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$"

In Excel

Microsoft 365 has REGEXTEST with the same pattern: =REGEXTEST(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$"). Other versions can only check pieces, such as ISNUMBER(FIND("@",A2)).

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=REGEXMATCH(A2,"@")TRUE, TRUE, TRUE…Different resultOnly checks for an @, which is too loose. TRUE for all six addresses, since each one contains an @.

Common mistakes

  • This checks the shape, not whether the mailbox exists. Typos like gmial.com still pass.
  • Google Sheets also has ISEMAIL, which checks the shape by its own fixed rules. A pattern lets you decide exactly what passes.
  • A leading or trailing space makes a good address fail. Test TRIM(A2) if the data was pasted.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Check if an email address is valid

In B2, return TRUE if the email in A2 has a valid shape: text, one @, a domain, a dot and an ending of at least two letters. Fill down to B7.

Questions

How do I highlight invalid emails?

Use conditional formatting with the custom formula =NOT(REGEXMATCH($A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$")).

How do I stop people typing invalid emails?

Data > Data validation, with the criteria "Text is valid email", or a custom formula with the same REGEXMATCH.

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine.