The Excel SEARCH function returns the position of one text string inside another — like FIND, but forgiving. It ignores capitalization and understands the wildcards ? and *, which makes it the everyday choice for “does this cell mention…?” tests on messy, human-typed data: support tickets, product notes, address lines.
Syntax
| Argument | Description | |
|---|---|---|
find_text | Required | The text or wildcard pattern to locate. Case is ignored. ? matches any one character, * any run of characters; prefix with ~ to match a literal ? * or ~. |
within_text | Required | The string to look inside. |
start_num | Optional | Position to start looking from (default 1). Use it to skip past an earlier occurrence. |
Available in: every version of Excel. SEARCH always returns the position where the match starts, counting from 1 — even for a wildcard pattern that goes on to match many characters. When the pattern isn’t found, the result is #VALUE!.
The “contains text” test
Customers type "REFUND", "Refund", and "refund" — SEARCH catches them all. The ISNUMBER wrapper converts position-or-error into a clean yes/no:
| A | B | |
|---|---|---|
| 1 | Ticket subject | Refund? |
| 2 | REFUND request - order 4417 | Yes |
| 3 | Login problem on mobile | No |
| 4 | Please refund shipping fee | Yes |
Position itself is useful too, exactly as with FIND:
Try it: SEARCH vs FIND, live
Search inside Order #4417: REFUND requested (shoes, size 9?). Toggle case and wildcards to see where SEARCH forgives and FIND refuses.
Wildcard patterns and SEARCH combos
Wildcards turn SEARCH into a mini pattern-matcher. ? stands for exactly one character, * for any number (including zero):
To hunt a literal question mark, asterisk, or tilde, escape it with ~:
SEARCH feeds extractions exactly the way FIND does — handy when the delimiter’s case is unpredictable:
Categorize messy text by testing several keywords (Excel 2019+ for IFS shown; nested IFs work everywhere):
Counting or replacing instead of locating? SUBSTITUTE swaps the text once you’ve found it; COUNTIF accepts the same wildcards for counting matching cells.
Errors & common pitfalls
#VALUE! — pattern not found. SEARCH’s only error in normal use (bad start_num aside). Unlike FIND, capitalization is never the culprit — the text genuinely isn’t there. Wrap in IFERROR(…, 0) or test with ISNUMBER.
Pitfall: wildcards fire when you meant them literally. Searching customer text for "?" returns 1 on every non-empty cell, because ? matches any single character. Escape it: =SEARCH("~?", A2) — or use FIND, which takes everything literally.
Pitfall: case-insensitivity can over-match. Looking for the unit "MB"? SEARCH also hits "Mb", "mb", and the letters inside "lumber". When capitalization carries meaning, switch to FIND; to avoid mid-word hits, search for the term with surrounding spaces.
Pitfall: SEARCH reports where a * match starts, not how long it is. =SEARCH("o*d", "Order 4417") returns 1 — and tells you nothing about the match’s span. Wildcard SEARCH is best used inside ISNUMBER as a yes/no test rather than for measuring extractions.
Practice workbook
Frequently asked questions
What's the difference between SEARCH and FIND?
? * (escape with ~); FIND matches case exactly and treats those characters literally. Identical arguments and outputs otherwise. Messy human text → SEARCH; precise codes where case matters → FIND.How do I test if a cell contains a word, ignoring case?
=ISNUMBER(SEARCH("word", A2)) returns TRUE or FALSE. The wrapper matters: a bare SEARCH returns #VALUE! on a miss, which breaks IF logic on its own.How do wildcards work in SEARCH?
? matches exactly one character, * matches any run of characters (even none), and ~ escapes the next character so ~? means a real question mark. So =SEARCH("inv-????", A2) finds "INV-" followed by any four characters.Why does SEARCH return #VALUE!?
IFERROR or ISNUMBER.How do I search for a literal question mark or asterisk?
=SEARCH("~?", A2) finds a real ?, =SEARCH("~*", A2) a real *, and ~~ a real tilde. Or simply use FIND, which never treats them as wildcards.Can SEARCH look at a whole range of cells?
=COUNTIF(A2:A100, "*refund*").Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class