# REGEXTEST formula generator

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

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

REGEXTEST checks whether text contains a match for a regular expression and returns TRUE or FALSE.

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

## Tested REGEXTEST examples

### Count cells that match a regex

`=SUMPRODUCT(--REGEXTEST(A2:A11,D1))`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/count-cells-that-match-a-regular-expression)

### Look up a value with a regular expression

`=FILTER(A2:B9,REGEXMATCH(A2:A9,E1))`

Google Sheets. Result on the sample sheet: 5 rows (E2:F6). [See it and try it](https://spreadsheetpractice.com/formulas/regex-lookup-google-sheets)

### Use REGEXMATCH with IF

`=IF(REGEXMATCH(A2,"^\d{5}(-\d{4})?$"),"Valid","Check")`

Google Sheets. Result on the sample sheet: 7 rows (B2:B8). [See it and try it](https://spreadsheetpractice.com/formulas/regexmatch-with-if)

### Check if a cell contains only numbers

`=REGEXTEST(A2,"^\d+$")`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-cell-contains-only-numbers)

### Check if an email address is valid

`=REGEXTEST(A2,"^[^@\s]+@[^@\s]+\.[A-Za-z]{2,}$")`

Excel. Result on the sample sheet: 7 rows (B2:B8). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-email-address-is-valid)

### Check if text matches a pattern

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

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-text-matches-a-pattern)

## Questions

### What does the REGEXTEST formula generator do?

You describe the task in plain English, and it writes the formula, using REGEXTEST 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 REGEXTEST do?

REGEXTEST checks whether text contains a match for a regular expression and returns TRUE or FALSE.

### Can I learn to write REGEXTEST 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 REGEXTEST 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.
