Spreadsheet Practice

How to extract an email address from text in Google Sheets

Google Sheets formula

=IFERROR(REGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w"),"")

Use REGEXEXTRACT with an email pattern: =IFERROR(REGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w"),"").

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

See it work

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

How it works

The pattern is: name characters (letters, digits, dots, plus and minus), an @, a domain name, a dot, and an ending that must finish on a letter or digit. That last rule stops the period at the end of "omar@contoso.example." from being included. IFERROR turns the #N/A for messages without an address into a blank.

=IFERROR(REGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w"),"")

Result"lena.park@northwind.example"

  1. A2"Please contact lena.park@northwind.example for details"

    The value in A2.

  2. REGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w")"lena.park@northwind.example"

    REGEXEXTRACT: The first match, or the captured group(s). #N/A when nothing matches.

    • textA2"Please contact lena.park@northwind.example for details"
    • regular_expression"[\w.+-]+@[\w-]+\.[\w.-]*\w"
  3. IFERROR(REGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w"),"")"lena.park@northwind.example"

    IFERROR: Returns a fallback when the value is any error.

    • valueREGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w")"lena.park@northwind.example"
    • value_if_error""not used

In Excel

Excel 365 has REGEXEXTRACT, and the same pattern works there. Older versions have no pattern matching; use Flash Fill (Ctrl+E) for a one-off.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=LOWER(IFERROR(REGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w"),""))lena.park@northwind.example, omar@contoso.example, p.shah+orders@fabrikam.example…Different resultAlso lowercases the address, ready for matching against a contact list. tom.becker@litware.example in lowercase.

Common mistakes

  • Only the first address in a cell is returned.
  • No pattern catches every valid address. This one covers the common forms; rare ones with quotes or IP addresses are missed.

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.

Extract an email address from text

In B2, extract the email address from the message, or leave it blank if there is none. Fill down to B6.

Questions

How do I extract every email in the cell?

Split into words and keep the matches: =TEXTJOIN(", ",TRUE,ARRAYFORMULA(IFERROR(REGEXEXTRACT(SPLIT(A2," "),"[\w.+-]+@[\w-]+\.[\w.-]*\w"),""))).

How do I check whether a cell contains an email at all?

Use REGEXMATCH with the same pattern: =REGEXMATCH(A2,"[\w.+-]+@[\w-]+\.\w+").

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