The short answer
FIND and SEARCH both return the position of one piece of text inside another, as a number. Position 1 is the first character. They differ in two ways:
- Case: FIND is case-sensitive, so “A” and “a” are different. SEARCH ignores case.
- Wildcards: FIND treats
?and*as ordinary characters. SEARCH treats them as wildcards, where?matches any single character and*matches any run of characters.
Use FIND when case matters. Use SEARCH when it doesn’t, or when you need a wildcard.
See the difference with examples
| Formula | Result | Why |
|---|---|---|
=FIND("A","abc A") |
5 | Only the capital A matches |
=SEARCH("A","abc A") |
1 | SEARCH ignores case, so the lowercase a matches |
=FIND("r?d","red") |
#VALUE! | FIND reads the ? as a literal question mark |
=SEARCH("r?d","red") |
1 | The ? matches the e |
Check whether a cell contains some text
Both functions return an error when the text isn’t found, so their result can’t go straight into an IF test. Wrap the function in ISNUMBER, which returns TRUE when it gets a number:
=ISNUMBER(SEARCH("apple",A2))returns TRUE if A2 contains “apple” in any case.=ISNUMBER(FIND("Apple",A2))returns TRUE only when the capital A and the rest match exactly.
To label the result, put it inside IF, as in =IF(ISNUMBER(SEARCH("apple",A2)),"Yes","No"). More ways to check for text are in excel if cell contains specific text.
Find the position and cut text around it
The number from either function works as a starting point for LEFT, MID and RIGHT. For example, =MID(A2,FIND("-",A2)+1,3) takes the three characters after the first dash, so AB-123 returns 123. Case only matters with letters, so FIND and SEARCH give the same result for a dash. For more on cutting text out, see how to extract text from a cell in excel.
Handle text that isn’t there
FIND and SEARCH return #VALUE! when the text is missing. Wrapping them in IFERROR can give a value you can test instead:
=IFERROR(SEARCH("apple",A2),0)
This returns 0 when there’s no match. Positions start at 1, so 0 can never be a real position, which makes it a safe flag. The wider question of when to hide errors is covered in how to hide errors in excel formulas.
Start the search at a later position
Both functions take an optional third argument, start_num, which says where to begin looking. =FIND("-",A2,5) skips the first four characters and finds the next dash after them. This is how you find the second dash in a code like AB-123-XY.
Keep these points in mind
- Both return only the first match. To find a later one, change the start position.
- Leading spaces shift every position. If the spacing is inconsistent, clean the text first, as explained in remove extra spaces in excel formula.
- To count the cells that contain some text, COUNTIF with wildcards is often simpler than a position test. How to use countif in excel covers that.
- For a long formula that combines FIND or SEARCH with other functions, use Evaluate Formula to check each step. How to use evaluate formula in excel shows how.