FINDB
The FINDB function returns the position of the searched text within the viewed text.
Counts double-byte characters, such as hieroglyphs, as 2 characters. The function is case sensitive.
This is especially useful for texts with double-byte characters, such as Chinese or Japanese.
Syntax
FINDB(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) The position of the character in the text being viewed up to which matches are ignored. By default, 1 | Positive integer or a reference to a cell with a number |
Examples of use
Search for a substring
=FINDB("apple", "I have an apple.")
This formula will return 11, since “apple” starts at the 11th position in the string “I have an apple.”
Search with initial position specified
=FINDB("a", "banana", 3)
This formula will return 4 since the character “a” in the word “banana” is in the 4th position (starting from byte 3).
Notes
- The FINDB function is case-sensitive.
- If the find_text is not found, the #VALUE! error is returned.
- To perform a search that ignores case, use the SEARCHB function.
- Two-byte characters (Eastern languages) count as 2 positions, single-byte characters count as 1.