FINDBfunction returns the starting position of a specified text string within another text string, counting from the end of the string. This function is useful when you need to search for a string from right to left. The search is case-sensitive.
- How to use
- Examples of using
FINDBformula not working?
- Similar formulas to
FINDB formula with the syntax shown below, it has 2 required parameters and 1 optional parameter:
- search_for (required):
The text you want to find within
- text_to_search (required):
The text in which you want to search for
- starting_at (optional):
Optional. The character position within
text_to_searchat which to start the search. If omitted, the search will begin at the end of the string.
ExamplesHere are a few example use cases that explain how to use the
FINDBformula in Google Sheets.
Finding the last occurrence of a character
You can use
FINDB to find the position of the last occurrence of a character within a text string. For example, to find the position of the last forward slash (/) in a URL, you could use
Extracting a file extension
You can use
FINDB to extract the file extension from a file name. Assuming the file name is in cell A1, the formula
=RIGHT(A1,LEN(A1)-FINDB(".",A1)) will return the file extension.
Searching from a specific position
You can use the
starting_at parameter of
FINDB to search for a string starting from a specific position within another string. For example, to find the second occurrence of a character in a text string, you could use
=FINDB(search_for, text_to_search, FINDB(search_for, text_to_search) + 1).
FINDBnot working? Here are some common mistakes people make when using the
FINDBGoogle Sheets Formula:
Missing quotation marks around text parameters
One common mistake is forgetting to include quotation marks around text parameters. This will cause the function to return a #NAME? error value.
Specifying a starting position that is outside the length of the text string
Another common mistake is specifying a starting position that is outside the length of the text string. This will cause the function to return the #VALUE! error value.
The following functions are similar to
FINDB or are often used with it in a formula:
FINDformula in Google Sheets searches for a specific text within another text and returns the position of the first occurrence of the text. This formula is often used to extract a substring from a larger string or to check if a certain text exists within another text.
LEFTformula is used to extract a specific number of characters from the beginning of a text string. It is most commonly used to extract the first name or last name from a full name or to extract a date from a text string.
RIGHTformula in Google Sheets returns the rightmost characters from a string, based on the number of characters specified. It is commonly used to extract a certain number of characters from the end of a string. The formula takes two arguments: the string from which to extract the characters, and the number of characters to extract.
You can learn more about the
FINDB Google Sheets function on Google Support.