Excel SEARCH Function
SEARCH finds where one text string starts inside another, ignoring case, and supports wildcards. Syntax, examples, and errors explained.
SEARCH finds the starting position of one text string inside another and returns that position as a number. It doesn't care about uppercase or lowercase, and it accepts two wildcard characters, ? and *, that let you match patterns instead of exact text. If SEARCH can't find what you're looking for, it returns a #VALUE! error rather than a blank or a zero, which matters when you're building formulas around it.
Available in: Excel 365, Excel 2021, Excel 2019, Excel 2016, and every earlier version back to Excel 2007. SEARCH has no version restrictions worth worrying about.
Syntax
=SEARCH(find_text, within_text, [start_num])
| Parameter | Required | Description |
|---|---|---|
find_text | Yes | The text you're looking for. Can include the wildcard characters ? (any single character) and * (any number of characters). |
within_text | Yes | The text or cell you're searching inside. |
start_num | No | The character position where the search begins. Defaults to 1 if omitted, meaning SEARCH scans from the very first character. |
Basic Example
You're reviewing a list of product descriptions in column B and need to find where the word "Sale" starts inside each one.
=SEARCH("Sale", B2)
// "Sale" = the text you're looking for
// B2 = the cell holding the full product description
If B2 contains "Summer Sale Collection", SEARCH scans from the left and finds "Sale" starting at character 8. The formula returns 8. Note that it would return the same result even if the cell read "summer sale collection" in lowercase. Case has no effect on the match.
How SEARCH Works
SEARCH ignores case
Uppercase and lowercase letters are treated as identical. SEARCH("e", "Excel") returns 1, matching the capital "E" at the start of the string, because SEARCH doesn't distinguish "E" from "e". This is the single biggest difference between SEARCH and its case-sensitive sibling, FIND.
SEARCH supports wildcards
find_text accepts ? to match any single character and * to match any run of characters. =SEARCH("s?le", "sale price") returns 1, because ? stands in for the letter "a". This makes SEARCH useful when you know part of a string but not the exact spelling.
start_num controls where scanning begins
By default SEARCH starts at character 1. Set start_num higher to skip past an earlier match. =SEARCH("o", "Bob Robertson", 4) skips the "o" in "Bob" and returns the position of the next one, at character 6.
SEARCH returns a position, not the matched text
The output is always a number representing a character position, never the text itself. To pull out the actual matched substring, pair SEARCH with MID or LEFT.
Common Use Cases
Check if a cell contains specific text
You want a TRUE/FALSE flag showing whether a customer note mentions "refund."
=ISNUMBER(SEARCH("refund", B2)) // returns TRUE if "refund" appears anywhere in B2, case-insensitive
ISNUMBER converts the position SEARCH returns into a clean TRUE, and converts the #VALUE! error into FALSE when no match exists.
Extract text that follows a known label
Your order IDs are formatted like "Order: SKU-4821" and you need just the SKU code.
=MID(B2, SEARCH("SKU-", B2), 8)
// SEARCH("SKU-", B2) = finds where "SKU-" starts
// 8 = pulls 8 characters from that point, covering "SKU-4821"
Split text before a delimiter
An invoice code like "INV-2024-0091" needs to be trimmed down to everything before the first hyphen.
=LEFT(B2, SEARCH("-", B2) - 1)
// SEARCH("-", B2) = position of the first hyphen
// - 1 = stop one character before it, excluding the hyphen itself
Flag rows with a custom result instead of TRUE/FALSE
You're scanning support tickets for the word "urgent" and want a readable label instead of a boolean.
=IF(ISNUMBER(SEARCH("urgent", B2)), "Escalate", "Normal")
Handling Errors
SEARCH throws #VALUE! when it can't locate find_text inside within_text. This is a real, catchable error, not a zero or blank result, so IFERROR works here.
Common causes of #VALUE!:
- The substring genuinely doesn't exist in the cell
start_numis set higher than the length ofwithin_text- A wildcard doesn't match anything because the text has an unexpected character in that position
- You meant to search for a literal
?or*but didn't escape it
=IFERROR(SEARCH("Sale", B2), "Not found")
To search for a literal question mark, asterisk, or tilde instead of using them as wildcards, put a tilde in front: ~?, ~*, or ~~. Without the tilde, =SEARCH("50% off*", B2) treats the asterisk as "match anything," not as a literal character in a product code.
Notes & Gotchas
What is the difference between the SEARCH and FIND functions in Excel?
SEARCH and FIND both return the starting position of a substring, but SEARCH ignores case and accepts wildcards, while FIND is case-sensitive and treats ? and * as literal characters. SEARCH("e", "Excel") returns 1 because it matches the capital "E." FIND("e", "Excel") returns 4 because it only matches the lowercase "e." If you need exact-case matching, use FIND, not SEARCH.
How do you use the SEARCH function in Excel?
Give SEARCH the text you're looking for, the cell or string to search inside, and optionally a starting position. =SEARCH("Invoice", A2) returns the character number where "Invoice" begins in cell A2, counting from the left with the first character as position 1.
Can wildcard characters be used with the SEARCH function?
Yes. The question mark (?) matches any single character, and the asterisk (*) matches any sequence of characters, both only inside find_text. =SEARCH("inv*2024", A2) matches anything starting with "inv" and ending in "2024," regardless of what falls in between.
How can SEARCH be combined with other functions like MID or FIND?
SEARCH is rarely used alone. Pair it with MID to extract text starting at the position it finds, with LEFT or RIGHT to trim text around a delimiter, or with ISNUMBER to convert its output into a TRUE/FALSE contains check. You can also nest it inside FIND when you need one case-insensitive lookup and one case-sensitive lookup in the same formula for comparison.
Does SEARCH work across multiple cells at once with dynamic arrays?
Yes, but only in Excel 365, where feeding SEARCH a range spills the result automatically. =SEARCH("Sale", B2:B20) returns a column of positions or errors, one per row, without needing to copy the formula down manually. In Excel 2019 and earlier, the same formula needs to be entered as a legacy array formula with Ctrl+Shift+Enter, and it won't spill on its own.
SEARCH's wildcard support is limited to ? and *. It cannot match character ranges or complex patterns the way REGEXTEST or REGEXEXTRACT can. If you're matching anything more sophisticated than "starts with" or "one unknown character," a regex function will save you a lot of nested SEARCH formulas.
Related Functions
| Function | Use this when... |
|---|---|
ISNUMBER | You want a clean TRUE/FALSE "contains text" result instead of a position number. |
XLOOKUP | You're matching whole cell values against a table, not searching for a substring inside text. |
Related Functions
Excel COUNTIF Function
COUNTIF counts cells that match a single condition — no formulas, no helper columns. Here's how the syntax works and where people get it wrong.
Excel HLOOKUP Function
HLOOKUP finds a value in the first row of a table and returns data from any row below it. In Excel 365 and 2021, XLOOKUP replaces it entirely.
Excel IF Function
IF is the function behind almost every conditional formula in Excel — pass or fail, over or under budget, yes or no. Here's how to write one that works on the first try.
Excel IFERROR Function
IFERROR replaces ugly error codes like #N/A and #DIV/0! with a value you choose. It's simple to use, but it catches every error type — including the ones you didn't mean to hide.