Extract an email address from text
Pull the email address out of a sentence or a messy cell using a regular expression.
The formula
Excel · Excel 365 only (REGEX functions)
=REGEXEXTRACT(A2, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")Google Sheets
=IFERROR(REGEXEXTRACT(A2, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}"), "")How it works
[A-Za-z0-9._%+-]+The name part: letters, digits and . _ % + -
@[A-Za-z0-9.-]+The @ sign followed by the domain name.
\.[A-Za-z]{2,}A dot and an ending of two or more letters, like .com or .co.uk.
Example
| A: Text | B: Result |
|---|---|
| Contact: jane.doe@acme.com (sales) | jane.doe@acme.com |
| No email here |
Tips
- Use the Regex formula tool to build patterns for phone numbers, IDs and more.