REGEXTEST function

REGEXTEST checks whether a text string matches a regular-expression pattern and returns TRUE or FALSE, optionally respecting case sensitivity.

=REGEXTEST(text, pattern, [case_sensitivity])

Generate a REGEXTEST formula

Describe what you need. The generator will reach for REGEXTEST where REGEXTEST is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How REGEXTEST reads its arguments
textrequiredpatternrequiredcase_sensitivityoptionalREGEXTEST
ArgumentRequiredDescription
textRequiredThe text (or cell reference) to evaluate; if omitted or an error value, REGEXTEST returns an error.
patternRequiredA regular-expression string that defines the match criteria; invalid regex syntax triggers a #VALUE! error.
case_sensitivityOptionalOptional flag (0 for case-sensitive, 1 for case-insensitive); omitted defaults to case-insensitive matching.

Returns

A single Boolean value (TRUE or FALSE) for each call.

Availability

Excel: 365 (2024+) · Google Sheets: Not available

Worked examples

1. Identify design-related tasks

TaskOwnerStart DateDue DateHours Logged
Design UIAlice2024-01-022024-01-0512
=REGEXTEST(A2, "Design")

Result: TRUE

The formula looks at cell A2, which contains "Design UI". The pattern "Design" appears at the start of the string, so REGEXTEST evaluates to TRUE. This lets you quickly flag any row whose task description mentions design work.

2. Case-sensitive owner name check

TaskOwnerStart DateDue DateHours Logged
Develop backendBob2024-01-032024-01-1020
=REGEXTEST(B2, "^a", 0)

Result: FALSE

Here we test whether the Owner cell B2 begins with a lowercase "a". The optional third argument 0 forces case-sensitive matching, and "Bob" starts with an uppercase "B", so the pattern does not match and the function returns FALSE. Changing the flag to 1 would make the test case-insensitive.

3. Find due dates in the second week of January

TaskOwnerStart DateDue DateHours Logged
Write documentationCharlie2024-01-042024-01-078
=REGEXTEST(D2, "^2024-01-0[5-9]")

Result: TRUE

The pattern "^2024-01-0[5-9]" matches any date string that starts with "2024-01-0" followed by a digit 5 through 9, i.e., the 5th to 9th of January. Cell D2 contains "2024-01-07", which satisfies the pattern, so REGEXTEST returns TRUE. This approach is handy for flagging tasks due in a specific week without converting dates to serial numbers.

Common errors

Which REGEXTEST error are you seeing?
REGEXTEST returned an error#VALUE!
Correct the regex by escaping special characters or fixing the quantifier, e.g., change "[0-9" to "[0-9]".
#SPILL!
Clear the cells where the array result should appear or wrap the call in an aggregation like SUM or use @ to force a single-cell result.
#N/A
Wrap the argument with IFERROR or IFNA to supply a fallback value, e.g., IFERROR(A2, "").
ErrorWhy it happensHow to fix it
#VALUE!The pattern argument contains malformed regular-expression syntax, such as an unescaped bracket.Correct the regex by escaping special characters or fixing the quantifier, e.g., change "[0-9" to "[0-9]".
#SPILL!REGEXTEST is entered over a range that returns multiple Boolean results, but the surrounding cells are occupied, preventing the spill.Clear the cells where the array result should appear or wrap the call in an aggregation like SUM or use @ to force a single-cell result.
#N/AOne of the arguments (usually the text cell) contains the error value #N/A, which propagates through the function.Wrap the argument with IFERROR or IFNA to supply a fallback value, e.g., IFERROR(A2, "").

Tips and when to use something else

  • Use ^ and $ anchors in your pattern to test for matches at the start or end of the string, respectively.
  • When you only need a simple substring search, the SEARCH function is faster and does not require regex knowledge.
  • Combine REGEXTEST with FILTER to extract whole rows that meet a pattern, e.g., =FILTER(A:E, REGEXTEST(A:A, "Design"))
  • Remember that the optional case_sensitivity flag defaults to case-insensitive; set it to 0 for strict case matching.

Frequently asked questions

Why does REGEXTEST return FALSE for a string that clearly contains the word?
REGEXTEST respects the whole pattern you provide. If you omit anchors or use case-sensitive mode unintentionally, the match may fail. Double-check the pattern and the third argument.
Can REGEXTEST be used on entire columns at once?
Yes. Supplying a column reference like A:A returns an array of TRUE/FALSE values, which will spill into adjacent cells. Ensure the spill area is clear, or wrap the call in an aggregation function if you need a single result.
How do I match a literal backslash in a regex pattern?
Backslashes are escape characters in regex, so you need to double them. For example, to match "C:\Folder", use the pattern "C:\\Folder".
Is REGEXTEST available in Google Sheets?
No. Google Sheets does not currently implement REGEXTEST; instead, you can use REGEXMATCH, which provides similar Boolean matching capabilities.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17