Skip to content
ExcelExcel Microsoft 365+

REGEXTEST function in Excel

Determines whether any part of text matches the pattern

=REGEXTEST(text, pattern, [case_sensitivity])

REGEXTEST syntax and parameters

Three arguments, two required.

  • textstringRequired

    The text or the reference to a cell containing the text you want to match against.

  • patternstringRequired

    The regular expression ("regex") that describes the pattern of text you want to match.

  • case_sensitivitynumberOptional

    Determines whether the match is case-sensitive. By default, the match is case-sensitive. Enter one of the following:0: Case sensitive1: Case insensitive

REGEXTEST examples

Formulas you'll actually reuse.

  1. Is this a well-formed email address?

    =REGEXTEST(B2, "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$")

    ResultTRUE

  2. Only the rows whose order code starts with the NYC prefix:

    =FILTER(A2:C200, REGEXTEST(A2:A200, "^NYC-"))

REGEXTEST in Google Sheets

No direct equivalent — here's the way around.

Try REGEXTEST in the playground

Edit the example — nothing to install.

Preloaded with the REGEXTEST formula from Example 1 — change anything and watch it respond.

Loading the editor…

REGEXTEST errors

What they mean — and the fixes.

  • #VALUE!

    The pattern isn't valid regex — look for an unbalanced bracket or an unescaped special character.