FormulaCraft

How to check if a cell contains specific text in Excel and Google Sheets

Excel & Google Sheets
=ISNUMBER(SEARCH("abc", A2))

Verified example

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

Text
abcdef

=ISNUMBER(SEARCH("abc", 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

Step by step

  1. 1Pick the cell where you want the TRUE/FALSE result.
  2. 2Enter =ISNUMBER(SEARCH("abc",A2)), replacing "abc" with the substring to find and A2 with the cell to check.
  3. 3SEARCH("abc",A2) returns the position number if found, or a #VALUE! error if not.
  4. 4ISNUMBER converts that to TRUE (found) or FALSE (not found).
  5. 5Copy down the column to test every row, or wrap in IF to return your own label.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Why not just use SEARCH on its own?

SEARCH returns a position number when found and a #VALUE! error when not. ISNUMBER converts both outcomes to a clean TRUE/FALSE that's safe to use in IF, COUNTIF, and conditional formatting without error handling.

How do I make it case-sensitive?

Swap SEARCH for FIND: =ISNUMBER(FIND("abc",A2)). FIND distinguishes "ABC" from "abc"; SEARCH does not.

How do I check if a cell contains text and return another value?

Wrap the check in IF: =IF(ISNUMBER(SEARCH("abc",A2)),"Yes","No") returns Yes when found, otherwise No. Replace "Yes"/"No" with any values, including references like B2.

How do I check for multiple substrings at once?

For OR logic (any match): =IF(SUMPRODUCT(--ISNUMBER(SEARCH({"abc","xyz"},A2)))>0,"Match",""). For AND logic (all must appear): =AND(ISNUMBER(SEARCH("abc",A2)),ISNUMBER(SEARCH("xyz",A2))).

How do I check if a cell starts with or ends with specific text?

Starts with: =LEFT(A2,3)="abc". Ends with: =RIGHT(A2,3)="abc". Use FIND/SEARCH only when the substring can appear anywhere in the cell.

Can I use COUNTIF with wildcards instead?

Yes — =COUNTIF(A2,"*abc*")>0 is shorter for a single substring. ISNUMBER+SEARCH wins when you need to combine multiple conditions or use the position number itself elsewhere.

Why does my formula return #VALUE! instead of FALSE?

You probably used SEARCH or FIND alone without ISNUMBER. Both return an error when the substring isn't found — ISNUMBER converts that error to a clean FALSE.

Formulas used

Related tasks

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

Last reviewed: