How to Extract Data from Emails into Excel (Gmail, No Code)
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:
| Type | Examples | How you get it |
|---|---|---|
| Metadata (fields every email has) | Sender address, subject, date, sent/received | Comes out of the export as ready-made columns |
| Values inside the text | Order number, total, tracking number, a phone typed into a form | Export 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):
from:orders@shop.example subject:"order confirmation" after:2026/07/01for one store's orders since Julyfrom:notifications@forms.example subject:"new submission"for web-form leadssubject:invoice has:attachment older_than:1yfor invoices from more than a year ago
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:
| Column | Contains | Plan |
|---|---|---|
| Sender (or recipient) address | Free | |
| Subject | Subject line | Free |
| Body (preview) | The first part of the message text | Free |
| Service | Sending domain/service | Free |
| Date & direction | When, and whether sent or received | Pro |
| Name & phone | Contact name and phone from signatures | Pro |
| Excel (XLSX) and JSON formats | Same data, other file types | Pro |
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 FreeStep 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:
- TEXTAFTER
(text, delimiter, …)returns everything after the label. - TEXTBEFORE
(text, delimiter, …)returns everything before the ending. Nest the two to grab the middle. - TEXTSPLIT
(text, col_delimiter, …)splits one cell into several columns at once. Pass several labels as an array:{"Name: ","Email: "}.
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.
| Field | Sample preview text | Excel (365 / 2024) | Google Sheets | Result |
|---|---|---|---|---|
| Order number | Order #A-10482 has been confirmed. | =TEXTBEFORE(TEXTAFTER(C2,"Order #")," ") | =REGEXEXTRACT(C2,"Order #([A-Z0-9-]+)") | A-10482 |
| Total | Order 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 number | Tracking number: 1Z999AA10123456784. Carrier: UPS. | =TEXTBEFORE(TEXTAFTER(C2,"Tracking number: "),".") | =REGEXEXTRACT(C2,"Tracking number:\s*([A-Z0-9]+)") | 1Z999AA10123456784 |
| Invoice number | Invoice 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 form | Name: 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:
- Amounts with thousands separators. "€1,250.00" needs the comma removed before
VALUE:=VALUE(SUBSTITUTE(…,",","")). If your spreadsheet uses a comma as the decimal separator (common in Europe),VALUEmay misread "84.20". In that case, check your locale settings. - Case. In Excel, the fourth argument of TEXTAFTER set to
1makes the match case-insensitive (used in the Total row). In Sheets, start the pattern with(?i). - Loose patterns catch the wrong thing. A bare phone pattern like
\+?\d[\d\s-]{7,}also matches tracking and invoice numbers. Always anchor the pattern on the label ("Phone:"), as in the table. - Blanks are information. Filter the result column for blanks. Those rows either use a different template or have the value past the preview. Handle them by hand or with a second formula.
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:
| Option | Best for | Trade-offs |
|---|---|---|
| Export + formulas (this guide) | One-off or periodic jobs; historical emails; no setup | Manual 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 users | For 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 automations | High volume, many templates, PDF attachments, non-technical teams | Ongoing subscription; your emails are forwarded to or read by a third-party service, so review its privacy terms |
| Google Apps Script | Free automation inside Google Workspace; full message bodies | You 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: …".
- Search:
from:notifications@forms.example subject:"new submission". Open a few to confirm the fields are near the top. - Export the results to CSV and open it in Excel.
- 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. - Fill down, then copy the new columns and use Paste special › Values so they no longer depend on column C.
- 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:
| Name | Phone | Message | |
|---|---|---|---|
| Laura Pérez | laura@example.com | +1 512-555-0147 | Need 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.