SEARCH(find_text,within_text,[start_num])
=SEARCH("p","apple") // returns 2
The SEARCH function returns the position of a character within a string. In the example above, the substring "p" is found in the string "apple" at position 2. If the substring is not found, the function returns the #VALUE! error value.
Example: =SEARCH("the","The cat in the hat") // returns 1
The SEARCH function can also be used to find the position of a substring within a string, starting at a specified position within the string. In the example above, the substring "the" is found in the string "The cat in the hat" at position 1, even though "The" and "the" do not match on case.
=SEARCH("z","apple") returns #VALUE!
The SEARCH function can also be used to find out if a substring does not exist within a string after a specified position within the string. In the example above, the substring "z" is not found in the string "apple". As a result, the function returns the #VALUE! error value.The SEARCH function is a useful tool for finding a specific text string within another text string. The function returns the numerical starting position of one string within another.