FormulaCraft

REGEXMATCH

REGEXMATCH tests whether a text string contains a substring matching a given regular expression and returns TRUE or FALSE. It is a Google Sheets function ideal for validating data formats — such as checking if a cell contains a valid email, phone number, or alphanumeric code — and for filtering rows with FILTER.

Excel
=NOT(ISERROR(FIND("@",A2)))
Google Sheets
=REGEXMATCH(A2,"^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$")

Verified example

Computed by a real spreadsheet engine on the sample data below.

EmailValid?
user@example.comTRUE
notanemailFALSE
hello@mail.netTRUE
missing@FALSE

=NOT(ISERROR(FIND("@",A2)))TRUE

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1In Google Sheets, decide on the validation pattern — for example, use '^\d{5}$' to check for a 5-digit ZIP code.
  2. 2Enter =REGEXMATCH(A2,"^\d{5}$") — it returns TRUE if A2 is exactly 5 digits, FALSE otherwise.
  3. 3Wrap in IF to give a user-friendly label: =IF(REGEXMATCH(A2,"^\d{5}$"),"Valid","Invalid").

Need a version for your data?

Try: “Check whether each cell in a column contains a valid email address format

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: