Check if a cell contains a string, case insensitive, excel.
- User
Check if a cell contains a string, case insensitive, excel.
- Assistant
To check if a cell contains a specific string (case-insensitive) in Excel, you can use one of the following formulas depending on your needs.
✅ Option 1: Using SEARCH SEARCH is case-insensitive — perfect for this use. Formula: excelCopiar código=ISNUMBER(SEARCH("text", A1))
Explanation:
"text" → the string you’re looking for.
A1 → the cell to check.
SEARCH returns the position of "text" if found (e.g., 5), otherwise gives an error.
ISNUMBER converts that into TRUE (found) or FALSE (not found).
Example: If A1 contains Hello World:
=ISNUMBER(SEARCH("hello", A1)) → ✅ TRUE
=ISNUMBER(SEARCH("WORLD", A1)) → ✅ TRUE
=ISNUMBER(SEARCH("bye", A1)) → ❌ FALSE
✅ Option 2: If you want to return custom text You can wrap it in an IF statement: excelCopiar código=IF(ISNUMBER(SEARCH("text", A1)), "Found", "Not Found")
✅ Option 3: For partial match counting (in arrays) If you’re using newer Excel versions (Microsoft 365 / Excel 2021): excelCopiar código=FILTER(A1:A10, ISNUMBER(SEARCH("text", A1:A10)))
This will return all cells in A1:A10 containing "text", case-insensitive.
Would you like me to show how to make it case-sensitive as well (using FIND)?
- User
What if I want to know if it is not in a substring?
- Assistant
Good question 👍 — if you want to check that a cell does not contain a certain substring (case-insensitive), you can simply invert the logic of the SEARCH formula.
✅ Case-insensitive “NOT contains” check excelCopiar código=ISERROR(SEARCH("text", A1))
or equivalently: excelCopiar código=NOT(ISNUMBER(SEARCH("text", A1)))
Explanation:
SEARCH("text", A1) → returns a number if "text" is found, otherwise an error.
ISNUMBER(...) → TRUE if found.
NOT(...) or ISERROR(...) flips it → TRUE if not found.
🔹 Example A1 valueFormulaResultHello World=NOT(ISNUMBER(SEARCH("bye", A1)))✅ TRUE (does not contain “bye”)Hello World=NOT(ISNUMBER(SEARCH("hello", A1)))❌ FALSE (does contain “hello”)
✅ Optional — Return custom text excelCopiar código=IF(ISERROR(SEARCH("text", A1)), "Not Found", "Found")
Would you like it to handle multiple substrings (e.g., “does not contain any of these words”)?