When working with large datasets in Excel, you might need to search for specific words or phrases within a cell of text. Sometimes, you need to check if a certain keyword appears within a text string, but Excel’s built-in search functions can be a bit tricky to understand if you’re not familiar with them. That’s where two powerful functions come into play: SEARCH and ISNUMBER.
In this article, we’ll break down how to use SEARCH with ISNUMBER in a simple, easy-to-understand way. This combination will help you find words or phrases in your data and return clear, useful results.
---
What Are SEARCH and ISNUMBER?
1. SEARCH Function:
The SEARCH function in Excel is used to find the position of a specific substring (a word or part of a word) within a larger text string. It returns a number indicating the starting position of the first character of the substring.
For example:
SEARCH("apple", "I have an apple") would return 10, because "apple" starts at the 10th character in the string "I have an apple".
SEARCH("banana", "I have an apple") would return #VALUE!, because the word "banana" is not found in the string.
2. ISNUMBER Function:
The ISNUMBER function is a simple function that checks if a given value is a number. If the value is a number, it returns TRUE; otherwise, it returns FALSE.
For example:
ISNUMBER(10) returns TRUE, because 10 is a number.
ISNUMBER("apple") returns FALSE, because "apple" is not a number.
ISNUMBER(#VALUE!) returns FALSE, because #VALUE! is an error, not a number.
---
How Does SEARCH Work with ISNUMBER?
When combined, SEARCH and ISNUMBER can help us check if a specific word or phrase exists within a piece of text. Here’s how it works:
1. SEARCH looks for a keyword in a given text. If it finds the keyword, it returns the position of the first character of the keyword in the text.
2. ISNUMBER checks if the result from SEARCH is a number. If it is a number (meaning the keyword was found), ISNUMBER will return TRUE. If it’s an error (meaning the keyword wasn’t found), ISNUMBER will return FALSE.
Example 1: Simple Use Case
Let’s say you have a list of sentences, and you want to check if the word “apple” appears in each sentence.
You can use the following formula to check if the word "apple" is present in each sentence:
=ISNUMBER(SEARCH("apple", A2))
Explanation:
SEARCH("apple", A2) looks for the word "apple" in the cell A2.
If "apple" is found, SEARCH returns a number (the position of the first character of "apple").
ISNUMBER checks if SEARCH returned a number. If it did, the formula returns TRUE; otherwise, it returns FALSE.
Example 2: Checking Multiple Keywords
If you have a list of keywords and you want to check if any of them appear in a sentence, you can use SEARCH with OR and ISNUMBER. This is particularly useful if you need to search for more than one keyword in a text string.
To check for multiple keywords (like "apple" or "banana"), use this formula:
=OR(ISNUMBER(SEARCH("apple", A2)), ISNUMBER(SEARCH("banana", A2)))
Explanation:
SEARCH("apple", A2) looks for the word "apple" in A2.
SEARCH("banana", A2) looks for the word "banana" in A2.
The OR function checks if either SEARCH function returns a number. If either one does, the formula returns TRUE; otherwise, it returns FALSE.
Example 3: Dynamic Search with Multiple Keywords (Up to 100 Keywords)
If you have a large list of keywords (like 100), you can still use SEARCH with ISNUMBER by combining them in a more advanced way. Excel 365 or Excel 2021 can use dynamic arrays to simplify this process.
Let’s say you have 100 keywords in cells B1:B100, and you want to search for these keywords in cell A2. You can use the following formula:
=OR(ISNUMBER(SEARCH(B1:B100, A2)))
This formula will check if any of the 100 keywords in column B appear in the text in A2.
---
When Should You Use SEARCH with ISNUMBER?
Here are a few scenarios where this combination is especially useful:
Keyword Search: You have a list of items or keywords, and you need to check if any of them appear in a block of text.
Data Cleaning: You want to clean up a dataset by finding rows that contain specific terms or phrases.
Conditional Formatting: You can use this combination in conditional formatting rules to highlight cells that contain specific words.
Automating Tasks: For example, automatically categorizing or tagging data based on keywords.
---
Benefits of Using SEARCH and ISNUMBER in Excel
1. Simple and Efficient: It’s a straightforward way to search for words or phrases without complex scripting.
2. Flexible: You can search for one or multiple keywords, depending on your needs.
3. No Case Sensitivity: Unlike FIND, SEARCH is not case-sensitive, making it easier to find words without worrying about capital letters.
4. Easy Integration: It can be integrated into more complex formulas for automated data management and processing.
---