Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=IF(ISNUMBER(SEARCH("apple",A2)),"Contains apple","Does not contain")Computed by a real spreadsheet engine on the sample data below.
| Product | Flag |
| apple juice | |
| orange soda | |
| apple cider | |
| mango drink |
=IF(ISNUMBER(SEARCH("apple",A2)),"Contains apple","Does not contain")→Contains apple
Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
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.
SEARCH returns a #VALUE! error when the text is not found, not FALSE — so IF cannot use it directly. ISNUMBER maps "found" (a number) to TRUE and "not found" (an error) to FALSE.
Use FIND instead of SEARCH: =IF(ISNUMBER(FIND("Apple",A2)),"Match","No match"). FIND distinguishes upper and lower case; SEARCH does not.
Wrap several ISNUMBER(SEARCH(…)) tests in OR (any keyword) or AND (all keywords): =IF(OR(ISNUMBER(SEARCH("apple",A2)),ISNUMBER(SEARCH("pear",A2))),"Fruit","Other").
Inside COUNTIF/SUMIF/SUMIFS, yes: "*apple*" matches the word anywhere in the cell. IF itself does not accept wildcards in a plain comparison, which is why the ISNUMBER(SEARCH(…)) pattern exists.
Point the IF branches at cells instead of strings: =IF(ISNUMBER(SEARCH("apple",A2)),B2,""). The row’s value in column B is returned only for matching rows.
Replace #N/A, #DIV/0!, and other errors with a blank or a friendly message using IFERROR or IFNA. Works in Excel and Google Sheets.
Error fixNested IF formulas not working in Excel and Google Sheets — fix bracket mismatches, wrong evaluation order, overlapping conditions, and the 64-nesting limit.
How-toStop formulas showing 0: wrap them in IF to return an empty string, suppress zeros with a custom number format, or hide them sheet-wide — plus the VLOOKUP-returns-0 fix.
How-toUse SUMIF with wildcard criteria (*text*) to sum values in a column whenever a related column contains a specific substring.
How-toChain multiple IF functions inside each other to test several conditions and return different results for each scenario.
How-toCombine IF with AND or OR to test multiple conditions simultaneously and return a result based on whether all or any are true.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: