Excel FIND Function
The Excel FIND function returns the position (as a number) of one text string inside another. When the text is not found, FIND returns a #VALUE error.
- find_text - The text to find.
- within_text - The text to search within.
- start_num - [optional] The starting position in the text to search. Optional, defaults to 1.
The FIND function returns the position (as a number) of one text string inside another. If there is more than one occurrence of the search string, FIND returns the position of the first occurrence. FIND does not support wildcards, and is always case-sensitive. Use the SEARCH function to find the position of text without case-sensitivity and with wildcard support. When the text is not found, FIND returns a #VALUE error. Also note, when find_text is empty, FIND returns 1.
To return the position of the letter "A" in the word "Apple":
=FIND("A","Apple") // returns 1
Note hardcoded text values must be enclosed in double quotes (""). To find the position of the lowercase "the":
=FIND("the","The cat in the hat") // returns 12
Error if not found:
=FIND("Cat","The cat in the hat") // returns #VALUE!
Because FIND is case-sensitive, "Cat" (with uppercase "C") is not found and FIND returns a #VALUE! error.
To create a generic formula to test for a substring in another string, combine the ISNUMBER and FIND functions like this:
If FIND returns any valid number (a position), ISNUMBER returns TRUE. If FIND returns #VALUE! error (nothing found), ISNUMBER returns FALSE. This pattern appears in many other formulas and is explained in more detail here.
- The FIND function will return the location of the first instance of find_text in within_text.
- The location is returned as the number of characters from the start of within_text.
- Start_num is optional and defaults to 1.
- FIND returns 1 when find_text is empty.
- FIND will return #VALUE if find_text is not found in within_text.
- FIND is case-sensitive and does not support wildcards.
- Use the SEARCH function to search without case-sensitivity and/or to use wildcards.