Example 1
Case-insensitive position
C3 =SEARCH("rush",B3)
Result: 22
The search ignores case. "Customer asked for a " has 21 characters, so "rush" begins at 22.
C3 =SEARCH("rush",B3) returns 22
Returns the position of one piece of text inside another, ignoring case and allowing the wildcards ? and *.
Syntax
=SEARCH(, , )
All versions of Excel.
Try it
Edit the formula in C3 or change the inputs. The sheet recalculates as you type.
C3 =SEARCH("rush",B3) returns 22
SEARCH returns the position of one piece of text inside another. It is the forgiving cousin of FIND: SEARCH ignores upper and lower case and accepts wildcards. Use it when you don't care about capitals, or when part of what you are looking for is unknown.
=SEARCH("rush",A2) finds RUSH, Rush and rush alike.The result is a number, counted from the first character of within_text as position 1. If the text isn't found, SEARCH returns #VALUE!.
Two characters have special meaning in find_text:
? matches any single character. "k?ttle" matches kettle.* matches any run of characters, including none. "N*h" matches from the first N to the next h.To search for an actual question mark, asterisk or tilde, put a tilde before it. =SEARCH("~?",A2) finds the position of a literal question mark in Ready?.
SEARCH returns an error when nothing matches, which makes it easy to build a contains test: =ISNUMBER(SEARCH("rush",A2)) returns TRUE for any note that mentions rush in any case. Combine it with IF for a label: =IF(ISNUMBER(SEARCH("rush",A2)),"Priority","Standard").
COUNTIF and SUMIF accept wildcards in their criteria, so "*rush*" counts the cells that contain rush. Inside an IF or another calculation, SEARCH with ISNUMBER is the usual "contains" test.
Like FIND, SEARCH is mostly used to give LEFT, RIGHT or MID a position. =LEFT(A2,SEARCH("@",A2)-1) returns the part of an email address before the @. FIND and SEARCH behave the same here, so pick SEARCH when you want to tolerate case differences, and FIND when case matters.
| | FIND | SEARCH | |---|---|---| | Case | Case-sensitive | Ignores case | | Wildcards | No | ? and * | | Not found | #VALUE! | #VALUE! |
In Microsoft 365, =SEARCH("a",A2:A9) returns a result for every cell in the range, spilled down. In older versions, fill the formula down instead.
If the text you search for contains a ? or * that you meant literally, SEARCH treats it as a wildcard and may return the wrong position. Escape it with a tilde. This catches people searching for text like "What?" or product names with an asterisk.
? stands for any one character and * for any run of characters. To look for a real ?, * or ~, put a tilde in front of it: "~?".A2.#VALUE!. The position returned is still counted from the start of the text.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
C3 =SEARCH("rush",B3)
Result: 22
The search ignores case. "Customer asked for a " has 21 characters, so "rush" begins at 22.
C3 =SEARCH("rush",B3) returns 22
Example 2
C2 =IF(ISNUMBER(SEARCH("rush",B2)),"Priority","Standard")
Result: Priority
SEARCH finds RUSH even though the formula uses lower case. If B2 had no match, SEARCH would return #VALUE! and ISNUMBER would turn it into FALSE.
C2 =IF(ISNUMBER(SEARCH("rush",B2)),"Priority","Standard") returns Priority
Example 3
C2 =SEARCH("k?ttle",A2)
Result: 10
The ? stands for the "e" in kettle. A pattern of "k?ttle" matches six characters starting at position 10.
C2 =SEARCH("k?ttle",A2) returns 10
Example 4
C2 =SEARCH("~?",A2)
Result: 6
Without the tilde, ? would match any single character and the formula would return 1.
C2 =SEARCH("~?",A2) returns 6
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In C2, show Priority if the note in B2 mentions "rush" in any capitalisation, and Standard otherwise. Fill down to C5.
Answer in C2, then it fills down to C5.
Rush and RUSH mean different things in your data, use FIND instead.? and * in the search text are wildcards, even when you meant them literally. Put a tilde in front to search for the real character: "~?".#VALUE!, not #N/A, when the text isn't found. Wrap it in ISNUMBER or IFERROR to handle the error.=SEARCH("an",A2) finds "an" inside "Banana" and "Manager". Search for a longer string, or add delimiters.#VALUE!, even when the text would match earlier on.SEARCH ignores case and supports the wildcards `?` and `*`. FIND is case-sensitive and treats those characters literally. Otherwise they work the same way.
Use `=ISNUMBER(SEARCH("word",A2))`. It returns TRUE if the word appears anywhere in the cell, in any case, and FALSE otherwise.
Put a tilde before the character: `=SEARCH("~?",A2)` or `=SEARCH("~*",A2)`. Without the tilde, SEARCH treats the character as a wildcard.
The text isn't in the cell, or start_num is below 1 or beyond the end of the text. Check for typos and extra spaces. If you only want TRUE or FALSE, wrap it in ISNUMBER.
Not directly. Test each word and combine the results, for example `=OR(ISNUMBER(SEARCH("rush",A2)),ISNUMBER(SEARCH("urgent",A2)))`. In Microsoft 365 you can also search an array of words with `SEARCH({"rush","urgent"},A2)` and test it with `COUNT`.
SEARCH is taught in Logic and text, lesson 12: FIND vs SEARCH. Each lesson is a short, graded exercise like the one above.