Flag Rows That Match a Text Pattern With REGEXMATCH
Your customer list mixes company emails with personal Gmail addresses, and you need a TRUE/FALSE flag on each row so you can filter, count, or clean them up.
Excel & Google Sheets
How it works
REGEXMATCH is Google Sheets only: it returns TRUE if any part of the cell matches the regular expression. Two characters do the precision work here — the backslash escapes the dot, because in regex a bare . matches any character (so @gmail.com would also match ana@gmailXcom), and the $ anchors the pattern to the end of the text, so an address ending in @gmail.com.br won't sneak through. Excel's classic functions have no regex at all; the nearest equivalent is =ISNUMBER(SEARCH("@gmail.com",A2)), which finds the literal text anywhere in the cell — close, but it can't anchor to the end and treats the dot literally rather than as a pattern. Also note REGEXMATCH is case-sensitive: wrap the cell in LOWER, or start the pattern with (?i), if your data mixes cases.
When to use it
Use it whenever "contains this text" isn't precise enough: flag free-mail domains in a CRM export, catch order IDs that don't match your SKU format, or spot invoice references with stray characters.
Common mistakes
Did this formula help?
Engine-verified against the sample data aboveLast reviewed 2026-07-08