The SEARCH function is a built-in function in Excel that is categorized as a String/Text Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the SEARCH function can be entered as part of a formula in a cell of a worksheet.
Syntax: =SEARCH(find_text, within_text, start_num)
The SEARCH function syntax has the following arguments:
- find_text – The text to find.
- within_text – The text to search within.
- start_num – [optional] Starting position in the text to search. Optional, defaults to 1.
Example: Let’s look at some Excel SEARCH function examples and explore how to use the SEARCH function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following SEARCH examples would return:
Note: Use the SEARCH function to get the location of one text string inside another.
- SEARCH returns the position of the first character of find_text inside within_text.
- Unlike FIND, SEARCH allows the use of wildcards, and is not case-sensitive.
- SEARCH allows the wildcard characters question mark (?) and asterisk (*), in find_text.
- The ? matches any single character and the * matches any sequence of characters.
- To find a literal ? or *, use a tilde (~) before the character, i.e. ~* and ~?.