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.
Is this a well-formed email address?
=REGEXTEST(B2, "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$")Result
TRUEOnly 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.
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.
Related functions
More ways Excel gets this done.
- ARRAYTOTEXTReturns an array of text values from any specified rangeTextNo Google Sheets equivalent
- CHARReturns the character specified by the code numberTextGoogle Sheets
- CLEANRemoves all nonprintable characters from textTextGoogle Sheets
- CODEReturns a numeric code for the first character in a text stringTextGoogle Sheets
- CONCATCombines the text from multiple ranges and/or strings, but it doesn't provide the delimiter or IgnoreEmpty arguments.TextGoogle Sheets
- CONCATENATEJoins several text items into one text itemTextGoogle Sheets