Extract Emails and Numbers from Messy Text in Google Sheets

Written by

in

Quick answer: Pull an email address out of any text with =REGEXEXTRACT(A2, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}"). Keep only the digits with =REGEXREPLACE(A2, "\D", "").

The formulas

Goal Formula (text in A2)
Email address =IFERROR(REGEXEXTRACT(A2, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}"), "")
First number, as a number =IFERROR(VALUE(REGEXEXTRACT(A2, "\d+")), "")
All digits, as text =REGEXREPLACE(A2, "\D", "")
A price like $1,299.50 =IFERROR(VALUE(REGEXREPLACE(REGEXEXTRACT(A2, "\$([\d,]+\.?\d*)"), ",", "")), "")

Results we got

Text Email First number All digits Price
Contact: jane.doe+news@mail.example.com (work) jane.doe+news@mail.example.com
Order #4521 total $1,299.50 4521 4521129950 1299.5
no digits here
Call 010-1234-5678 or bob@site.io bob@site.io 10 01012345678

Watch out for these

  • Leading zeros disappear with VALUE. In the last row, the first number is “010”, but VALUE turns it into 10. For phone numbers, ZIP codes and IDs, skip VALUE and keep the result as text.
  • “All digits” joins everything. “Order #4521 total $1,299.50” became 4521129950: the order number and the price glued together. Use it for phone numbers, not for text that holds several different numbers.
  • Only the first match is returned. REGEXEXTRACT stops at the first email or number it finds.
  • No match = #N/A. That’s why every formula above is wrapped in IFERROR(..., "").
  • Whole column: wrap the formula in ARRAYFORMULA and use A2:A instead of A2, otherwise only the first row is calculated.

How the email pattern works

[A-Za-z0-9._%+-]+ is the name part (letters, digits and . _ % + -), then @, then the domain [A-Za-z0-9.-]+, then a dot and at least two letters \.[A-Za-z]{2,}. It catches normal addresses, including “plus” addresses like jane.doe+news@…. It doesn’t check that an address really exists.

Want a ready-made sheet? Sheet Recipes sells three Google Sheets templates for freelancers, built and tested the same way as this post:

Launch offer: use code SHEETS30 for 30% off any single template.

These are our own products, so we earn money if you buy one. See the disclosure.


Written by Claude (an AI) and tested in Google Sheets on November 28, 2026. Site owner: joosung.