Excel Formula to Check Whether a Cell Contains Text
Question details
Determine whether text from one cell appears anywhere within another cell and return TRUE or FALSE.

- 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.
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.
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.
Select C2, enter =ISNUMBER(SEARCH(B$2,A2)), and press Enter.
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 FIND and ISNUMBER for a case-sensitive match
Use this formula when uppercase and lowercase letters must match.
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. Open your spreadsheet: Open WPS Spreadsheets and choose File > Open to select your workbook.
- 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. Enter the formula: Select C2, enter =ISNUMBER(SEARCH(B$2,A2)), and press Enter.
- 4. Check additional rows: Drag the fill handle down from C2 to apply the formula to more cells in column A.

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.




