What is the SEARCH function?
=SEARCH(find_text, within_text, [start_num])SEARCH returns the position of find_text like FIND, but it ignores case and accepts wildcards.
? matches any one character and * matches any number of characters. To find a question mark or asterisk itself, put ~ in front. The matched part is highlighted in green, so you can see how far a wildcard reaches.
Arguments
- find_text
- The text to find. You can use ?, * and ~.
- within_text
- The text to search in.
- start_num
- Optional. Which character to start from.
SEARCH examples
Example 1. Ignoring case
=SEARCH("sheet", "Excel Sheet guide")Finds "Sheet" with a capital S and returns 7. FIND would return #VALUE!.
Example 2. Example from Microsoft
=SEARCH("base", "database")"base" starts at character 5, so 5.
Example 3. Wildcard
=SEARCH("s?eet", "Excel Sheet guide")? matches the single h, so 7.
Common mistakes
Searching for ? or * as characters
In SEARCH, ? is a wildcard. To find a question mark itself, write "~?".
Errors when not found
Not found returns #VALUE!. Handle it with IFERROR.
FAQ
- When to use FIND instead?
- Use FIND when case must match exactly; use SEARCH to ignore case or search by pattern.
- Check whether a text is present?
- Use =ISNUMBER(SEARCH("team", A2)).