The FIND function in Google Sheets is a powerful tool used to locate the position of a specific substring within a larger string of text. This function is essential for various text manipulation tasks, making it easier to analyze, extract, or modify data contained in cells. By providing the position of the first occurrence of a substring, users can streamline their data processing workflows.
Syntax
FIND(search_for, text_to_search, [starting_at])
- search_for: The substring you want to find within the text.
- text_to_search: The main string where the search will take place.
- [starting_at]: Optional. The position in the text to start searching from, defaulting to 1 if omitted.
Example #1
=FIND("apple", "I have an apple.")
This function will return 11, indicating that the substring “apple” starts at the 11th position in the text.
Example #2
=FIND("a", "banana", 2)
In this case, the function will return 4, as it finds the first occurrence of “a” starting from the 2nd position in the string.
Example #3
=FIND("an", "Pineapple")
Here, the result will be 4, signifying that “an” starts at the 4th position in the given string.
Error handling
- VALUE! – This error occurs if the search_for substring is not found in text_to_search.
- REF! – This indicates an invalid reference, particularly when the starting_at position exceeds the length of text_to_search.
- N/A – This error appears when search_for is a null or empty string, making it impossible to find.