Yes, there is an equivalent function to
"InStr" in Excel, it's called
"FIND" . The
FIND function returns the starting position of a substring within a string. Here's how you can use it:
- Open your Excel worksheet and select the cell where you want to use the FIND function.
- Type "=FIND(" in the cell.
- Enter the substring you want to find in double quotes, followed by a comma. For example, if you want to find the position of the word "apple" in the string "I like apples" , you would enter "=FIND("apple", "I like apples")" .
- Enter the string you want to search in double quotes, followed by a closing parenthesis. For example, "=FIND("apple", "I like apples")" .
- Press Enter to complete the formula.
The
FIND function will return the position of the first occurrence of the substring within the string. If the substring is not found, the function will return the
#VALUE! error.