# How to check if an email address is valid in Excel

Test the format with a pattern: =REGEXTEST(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$") in Excel 365, or REGEXMATCH with the same pattern in Google Sheets.

**Excel:** `=REGEXTEST(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$")` (Microsoft 365 only)

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

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Email | Valid format? |
| lena.park@northwind.example |  |
| omar@contoso |  |
| p.shah@@fabrikam.example |  |
| tom becker@litware.example |  |
| ines@adatum.example |  |
| raj.patel@proseware.co |  |
| @northwind.example |  |

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

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

## How it works

The pattern reads: one or more characters that aren't @ or a space, then an @, then more of the same, then a dot and at least two letters at the end. That rejects a missing dot ("omar@contoso"), two @ signs, spaces, and a missing name before the @.

## Other ways

- `=AND(LEN(A2)-LEN(SUBSTITUTE(A2,"@",""))=1,ISNUMBER(FIND(".",A2,FIND("@",A2)+2)),ISERROR(FIND(" ",A2)),LEFT(A2)<>"@")`: Works in every version: exactly one @, a dot at least one character after it, no spaces, and something before the @. Less strict than the pattern.

## Common mistakes

- A format check can't tell whether the mailbox exists. It only catches typos and junk.
- Patterns that are too strict reject real addresses. Plus signs, hyphens and long endings like .museum are all valid.
- Trailing spaces from imports fail the test. TRIM the column first.

## Questions

**Does Google Sheets have a built-in check?**

Yes: `=ISEMAIL(A2)` returns TRUE for a valid format.

**How do I stop invalid emails being typed in?**

Use the formula as a custom Data Validation rule on the column.

**How do I pull out the domain?**

`=TEXTAFTER(A2,"@")` in Excel 365, or `=MID(A2,FIND("@",A2)+1,99)` in any version.

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-email-address-is-valid
