The FIND function returns the position of the searched text within the viewed text.
Counts double-byte characters as 1 character. The function is case sensitive.
This function can be useful when you need to determine where a specific substring begins in a string.
Syntax
FIND(find_text, within_text, [start_num])
Argument |
Description |
Permitted values |
|---|---|---|
find_text |
String to be found in the value of the “within_text” argument |
Text string or reference to a cell containing text |
within_text |
Text in which the first occurrence of the value specified by the “find_text” argument is searched for |
Text string or reference to a cell containing text |
[start_num] |
(optional) Character number in the “find_text” argument value from which to start the search. By default, 1 |
Integer ≥ 1 or a reference to a cell containing a number |
Examples of use
Search for word position
If you have text in cell A1: “Hello, world!” and you want to find the position of the word “world”:
=FIND("world", A1)
This formula will return 8, since the word “world” begins with the eighth character.
Search from the sixth character (the same text)
=FIND("o", A1, 6)
This formula will return 9, since the letter “o” in the word “Hello” is ignored.
Searching for text that is not in a string
=FIND("sun", A1)
This formula will return the #VALUE! error, as “sun” is not found in the text.
Notes
–The FIND function is case-sensitive, meaning that “World” and “world” will be treated as different strings.
–If the find_text is not found, the function will return the #VALUE! error.
–To perform a search that ignores case, use the SEARCH function.