Home › Blog › Extract data from emails to Excel

How to Extract Data from Emails into Excel (Gmail, No Code)

Published September 28, 2026 · 12 min read
Export formats
Export formats
Gmail Exporter Guide
To extract data from emails into Excel without code: 1) search Gmail for only the emails that contain the data, 2) export those results to a CSV (one email per row), and 3) use formulas like TEXTBEFORE/TEXTAFTER in Excel or REGEXEXTRACT in Google Sheets to pull each value, such as an order number, total or phone, into its own column.

This works well for one-off or monthly jobs: a quarter's order confirmations, a year of invoices, or every contact-form notification since launch. If new emails must reach a spreadsheet automatically every day, a parser or automation tool is a better fit, and we compare those options below.

Below you'll find a formula cookbook for six common email fields, in both Excel and Google Sheets, with sample text you can paste in to test before you touch your own data.

What "extracting data" from email actually means

There are two kinds of data in an email, and they need different tools:

TypeExamplesHow you get it
Metadata (fields every email has)Sender address, subject, date, sent/receivedComes out of the export as ready-made columns
Values inside the textOrder number, total, tracking number, a phone typed into a formExport first, then split the text with formulas (or a parser)

Most "email to Excel" guides stop at metadata. The hard part, and the focus of this guide, is the second row: getting A-10482 out of "Thanks for your order! Order #A-10482 has been confirmed."

Step 1 — Narrow the emails with a search

Formulas work best when every row has the same layout. So export only one type of email at a time: one store's confirmations, one form's notifications, one supplier's invoices.

Use Gmail's search operators (see Google's list or our Gmail search operators cheat sheet):

Open two or three of the results and check that the values you want appear near the top of the message. That matters for the next step.

Step 2 — Export to CSV (what columns you get)

With the search results open, click the Gmail Exporter icon and export. It runs in your browser and saves the file to your computer. Here's what the file contains on each plan:

ColumnContainsPlan
EmailSender (or recipient) addressFree
SubjectSubject lineFree
Body (preview)The first part of the message textFree
ServiceSending domain/serviceFree
Date & directionWhen, and whether sent or receivedPro
Name & phoneContact name and phone from signaturesPro
Excel (XLSX) and JSON formatsSame data, other file typesPro

Be aware of the preview. The body column is a preview, not necessarily the full message. Order numbers, totals and form fields are usually near the top, so they're usually included. But a value that sits below a long banner or legal text may be cut off. Your formulas will return blank for those rows, which is a useful signal.

The free CSV opens in Excel directly. If accented names look garbled, import it with Data › From Text/CSV and choose UTF-8 (Microsoft's import guide). For more on file formats, see how to export Gmail to Excel.

Export the emails in one click, then let the formulas do the rest

Free CSV export. Pro adds dates, names and phones as ready-made columns.

Add to Chrome — It's Free

Step 3 — Pull values out with formulas

In the examples below, the body preview is in column C and the first email is in row 2. Change C2 to match your file, then fill the formula down.

Excel: TEXTBEFORE, TEXTAFTER, TEXTSPLIT and Flash Fill

Most email values sit between a fixed label and a fixed ending, such as between "Order #" and a space. Excel's text functions are built for exactly that:

Microsoft lists all three for Excel for Microsoft 365 (Windows and Mac) and Excel 2024. When a label isn't found, they return #N/A; wrap them in IFERROR(…,"") to leave the cell blank instead. Microsoft 365 also has REGEXEXTRACT; with return_mode set to 2, it returns the capturing group.

On older Excel versions, use Flash Fill. Type the value you want for the first two rows by hand, then press Ctrl+E. Excel guesses the pattern. It's quick, but check the results, because Flash Fill doesn't update when the data changes.

Google Sheets: REGEXEXTRACT and SPLIT

In Sheets, REGEXEXTRACT(text, regular_expression) returns the part of the text that matches a pattern, or the part in parentheses when you use a capture group. SPLIT breaks a cell into columns at a delimiter. Wrap either in IFERROR(…,"") to leave rows without a match blank.

Formula cookbook: 6 common email fields

The Sheets patterns were tested against the sample text shown in each row, and the Excel formulas follow Microsoft's documented syntax. Try them on a few rows before filling down. The sample text is made up; your emails will use their own labels. Replace the label in quotes (like "Order #") with the exact wording in your emails.

FieldSample preview textExcel (365 / 2024)Google SheetsResult
Order numberOrder #A-10482 has been confirmed.=TEXTBEFORE(TEXTAFTER(C2,"Order #")," ")=REGEXEXTRACT(C2,"Order #([A-Z0-9-]+)")A-10482
TotalOrder total: $84.20. Estimated delivery Oct 3.=VALUE(TEXTBEFORE(TEXTAFTER(C2,"total: $",,1),". "))=VALUE(REGEXEXTRACT(C2,"(?i)total:?\s*\$([\d,]+\.\d{2})"))84.2
Tracking numberTracking number: 1Z999AA10123456784. Carrier: UPS.=TEXTBEFORE(TEXTAFTER(C2,"Tracking number: "),".")=REGEXEXTRACT(C2,"Tracking number:\s*([A-Z0-9]+)")1Z999AA10123456784
Invoice numberInvoice INV-2026-0931 is due on 2026-10-15.=TEXTBEFORE(TEXTAFTER(C2,"Invoice ")," ")=REGEXEXTRACT(C2,"(INV-[\d-]+)")INV-2026-0931
Due date(same as above)=DATEVALUE(TEXTBEFORE(TEXTAFTER(C2,"due on "),"."))=DATEVALUE(REGEXEXTRACT(C2,"(\d{4}-\d{2}-\d{2})"))Oct 15, 2026 (format the cell as a date)
Phone from a formName: Laura Pérez Email: laura@example.com Phone: +1 512-555-0147 Message: Need a quote=TRIM(TEXTBEFORE(TEXTAFTER(C2,"Phone: "),"Message:"))=REGEXEXTRACT(C2,"Phone:\s*([+\d][\d\s().-]{6,}\d)")+1 512-555-0147

Notes that save time:

For ready-made contact columns, the Pro export pulls names and phones from signatures, so you don't need a formula for those.

When you need a real parser instead

Export-plus-formulas is a batch method: you run it when you need the data. A parser or automation runs continuously. Here's an honest comparison:

OptionBest forTrade-offs
Export + formulas (this guide)One-off or periodic jobs; historical emails; no setupManual re-run; body preview only on the free plan; no attachments' contents
Power Automate (Gmail connector)New emails landing in Excel automatically, for Microsoft 365 usersFor consumer @gmail.com accounts, Google's data policy limits which services the flow can use (Excel, OneDrive and SharePoint are among those allowed); the "When a new email arrives" trigger may skip emails at very high volume (Microsoft Learn)
Email parser services / Zapier-type automationsHigh volume, many templates, PDF attachments, non-technical teamsOngoing subscription; your emails are forwarded to or read by a third-party service, so review its privacy terms
Google Apps ScriptFree automation inside Google Workspace; full message bodiesYou write and maintain code, within Google's quotas (Gmail service reference)

Rule of thumb: if you'd run the job fewer than once a week, or you mostly need past emails, export and formulas are faster to set up. If the sheet must update itself every day, automate.

Worked example: web-form notifications → lead sheet

Say your website form sends a Gmail notification for each submission, and you want every lead since launch in one sheet. The notifications look like the phone row above: "Name: … Email: … Phone: … Message: …".

  1. Search: from:notifications@forms.example subject:"new submission". Open a few to confirm the fields are near the top.
  2. Export the results to CSV and open it in Excel.
  3. Split the whole message in one formula. In D2, enter =TRIM(TEXTSPLIT(C2,{"Name: ","Email: ","Phone: ","Message: "})). The result spills across five cells: the text before "Name:", then name, email, phone and message.
  4. Fill down, then copy the new columns and use Paste special › Values so they no longer depend on column C.
  5. Clean up: delete the first spilled column (the text before "Name:"), sort by email and use Remove Duplicates for leads who submitted twice.

The result looks like this:

NameEmailPhoneMessage
Laura Pérezlaura@example.com+1 512-555-0147Need a quote

The same method works for other recurring templates. See how to export order confirmations and export invoices for search queries tailored to those emails. If you need dates next to each lead, the Pro plan adds date and direction columns.

Frequently asked questions

Can I extract data from attachments or PDFs this way?

Not with formulas on the CSV. The export contains email fields and a body preview, not the text inside attached PDFs. The Business plan can download attachments as a ZIP, but reading values out of PDFs needs a document parser or manual entry.

Can the extraction run automatically for new emails?

The export is a manual, on-demand action. If new emails must land in a sheet without anyone clicking, use Power Automate's Gmail connector, Google Apps Script, or a dedicated email parser. For one-off or monthly jobs, export and formulas are faster to set up.

Does this work with Outlook?

The Gmail Exporter extension works in Gmail only. The formulas work on any CSV, so if you get Outlook emails into a spreadsheet another way, the same patterns apply.

What if the value isn't in the body preview?

The free export includes a preview of the body, not necessarily the whole message. If the value sits further down, the formula returns blank for that row. Check a few emails first; if key values are deep in the message, use a parser or script that reads full bodies.

Which Excel versions support TEXTBEFORE, TEXTAFTER and TEXTSPLIT?

Microsoft lists them for Excel for Microsoft 365 (Windows and Mac) and Excel 2024. REGEXEXTRACT is listed for Excel for Microsoft 365. On older versions, use Flash Fill, or open the CSV in Google Sheets and use REGEXEXTRACT there.