Text Search

Searching for specific text within a dataset is a common task in data analysis. Excel provides powerful functions like SEARCH and FIND to locate and extract specific parts of text strings. These functions are particularly useful for parsing and analyzing data effectively.

Use SEARCH and FIND to Locate Specific Text Within a Dataset

The SEARCH function returns the position of a substring within a text string, ignoring case sensitivity, while the FIND function also returns the position of a substring but is case-sensitive. These functions can help you identify the exact location of text within a dataset, allowing for more precise data manipulation.

Example

Below is an example dataset showing a list of phrases. This dataset will be used to demonstrate how to use the SEARCH and FIND functions to locate specific text within each phrase.

PhraseSearch "apple"Find "Apple"
I like apples8#VALUE!
Apple pie is delicious11

Exercise

Use the SEARCH and FIND functions to locate the specific text within the following phrases:

Use the functions to find the position of "data" and "Data" in each phrase.

Solution

To locate specific text within the phrases, follow these steps:

Apply Functions:

Search "data": Use the SEARCH function to locate the position of "data".

=SEARCH("data", A2)
=SEARCH("data", A3)

Find "Data": Use the FIND function to locate the position of "Data".

=FIND("Data", A2)
=FIND("Data", A3)

Explanation of #VALUE! Error

The #VALUE! error occurs in the FIND function when the specified substring is not found in the text string, or when the case does not match. Unlike SEARCH, FIND is case-sensitive, so it will return an error if the exact case of the substring is not present in the text string.

Please enable JavaScript in your browser to complete this form.
How would you rate this post?
Do you think adding a video explanation would be useful?
Your Excel Skill Level