# REGEXEXTRACT formula generator

> Describe what you need and get a REGEXEXTRACT formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested REGEXEXTRACT examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/regexextract · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

REGEXEXTRACT pulls out the part of a text that matches a regular expression: an order number, an email domain, the digits in a messy code.

Describe the task at [REGEXEXTRACT formula generator](https://spreadsheetpractice.com/tools/formula-generator/regexextract) and get a REGEXEXTRACT formula for Excel and Google Sheets, tested on real data.

## Tested REGEXEXTRACT examples

### Extract the domain from an email address

`=REGEXEXTRACT(A2,"@(.+)$")`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-the-domain-from-an-email)

### Extract text between parentheses

`=REGEXEXTRACT(A2,"\(([^)]*)\)")`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-text-between-parentheses-in-google-sheets)

### Extract text after a character

`=TEXTAFTER(A2,"@")`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-text-after-a-character)

### Fix the REGEXEXTRACT "expects text values" error

`=REGEXEXTRACT(TO_TEXT(A2),"^\d{3}")`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/fix-regexextract-expects-text-values-error)

### Extract several parts of text into columns with REGEXEXTRACT

`=REGEXEXTRACT(A2,"^([A-Z]+)-(\d{4})-(\d+)$")`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-parts-into-columns-with-regexextract)

### Sum cells that contain numbers and text

`=SUMPRODUCT(--SUBSTITUTE(B2:B6," kg",""))`

Excel. Result on the sample sheet: 53. [See it and try it](https://spreadsheetpractice.com/formulas/sum-cells-that-contain-numbers-and-text)

### Extract a date from text

`=DATEVALUE(REGEXEXTRACT(A2,"\d{1,2}/\d{1,2}/\d{4}"))`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-a-date-from-text-in-google-sheets)

### Extract a date from a text string

`=DATEVALUE(MID(A2,SEARCH("20??-??-??",A2),10))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-a-date-from-text)

## Questions

### What does the REGEXEXTRACT formula generator do?

You describe the task in plain English, and it writes the formula, using REGEXEXTRACT where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does REGEXEXTRACT do?

REGEXEXTRACT pulls out the part of a text that matches a regular expression: an order number, an email domain, the digits in a messy code.

### Can I learn to write REGEXEXTRACT formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the REGEXEXTRACT function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
