Function Problems

Excel Formula to Check Whether a Cell Contains Text

Phi Hung VoPhi Hung Vo Nov 14, 2026 868 views

Question details

Determine whether text from one cell appears anywhere within another cell and return TRUE or FALSE.

Excel Formula to Check Whether a Cell Contains Text
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to compare a search term with a cell that may contain additional text.
Observed behavior
The desired formula returns TRUE for a partial text match and FALSE when the search term is not found.
Before you start

Place the text to search in A2 and the search term in B2, or adjust the cell references in the formula to match your worksheet. Choose an empty cell for the result.

Solution 1Recommended

Use SEARCH and ISNUMBER for a case-insensitive match

Return TRUE when the text in B2 appears anywhere in A2, regardless of capitalization.

SEARCH returns the position of the text when it finds a match. ISNUMBER converts that position to TRUE and a not-found error to FALSE.

1
Enter the formula

Select C2, enter =ISNUMBER(SEARCH(B$2,A2)), and press Enter.

2
Copy the formula down

Drag the fill handle from C2 down the result column. The reference B$2 keeps the search term in row 2 while A2 changes for each row.

Use SEARCH and ISNUMBER for a case-insensitive match
Empty search term: If B2 is empty, the formula returns TRUE. To return FALSE instead, use =AND(B$2<>"",ISNUMBER(SEARCH(B$2,A2))).
Check text in spreadsheets

Check for text matches in WPS Spreadsheets

Use SEARCH and ISNUMBER in WPS Spreadsheets to check whether one cell contains text from another and return TRUE or FALSE.

  1. 1. Open your spreadsheet: Open WPS Spreadsheets and choose File > Open to select your workbook.
  2. 2. Prepare the cells: Enter the text to check in A2 and the search term in B2, or identify the corresponding cells in your worksheet.
  3. 3. Enter the formula: Select C2, enter =ISNUMBER(SEARCH(B$2,A2)), and press Enter.
  4. 4. Check additional rows: Drag the fill handle down from C2 to apply the formula to more cells in column A.
Check partial text matches with a formulaOpen and edit Microsoft Excel XLSX and XLS filesCopy formulas down a column for multiple checksUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Does SEARCH require an exact cell match?

No. In =ISNUMBER(SEARCH(B$2,A2)), the text in B2 can appear anywhere within A2, even if A2 contains additional text.

How can I make the text check case-sensitive?

Replace SEARCH with FIND: enter =ISNUMBER(FIND(B$2,A2)) in C2. FIND distinguishes uppercase from lowercase letters.

Why does the formula return TRUE when the search cell is blank?

SEARCH treats an empty search term as found. To return FALSE when B2 is blank, enter =AND(B$2<>"",ISNUMBER(SEARCH(B$2,A2))) in C2.

Can I search for a literal question mark or asterisk?

Yes. SEARCH treats ? and * as wildcards, so put a tilde before either character in the search term, such as ~? or ~*, to search for it literally.