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

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

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

**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))`.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Email | Valid? |
| ana.ruiz@northwind.com |  |
| raj@contoso |  |
| lee chen@fabrikam.com |  |
| kim@@litware.com |  |
| mo.diaz@adatum.co.uk |  |
| eve.lund@tailspin.io |  |

Formula in B2, filled to B7: `=REGEXMATCH(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$")`

Result: TRUE; FALSE; FALSE; FALSE; TRUE; TRUE

## 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 @.

## Other ways

- `=REGEXMATCH(A2,"@")`: Only 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.

## 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.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/check-if-an-email-address-is-valid
