SEARCHB
The SEARCHB function in Google Sheets returns the position at which a string is first found within text, counting each double-character as 2. It is a useful tool for searching within text and handling double-byte characters. Learn more about its syntax and usage below.
Function Syntax and Parameters
Syntax: SEARCHB(search_for, text_to_search, [starting_at])
Parameters:
search_for: The string to search for withintext_to_search.text_to_search: The text within which to search for thesearch_forstring.starting_at: [Optional] The position withintext_to_searchwhere the search should start. If omitted, the default is 1 (the first character).
Step-by-Step Tutorial
-
Using
SEARCHBto find the position of a string within text:- Example:
=SEARCHB("world", "Hello world") - Result:
7
- Example:
-
Using
SEARCHBwith a starting position:- Example:
=SEARCHB("world", "Hello world", 8) - Result:
0(since the search is started from position 8 where "world" is not found)
- Example:
Use Cases and Scenarios
- Language Processing: Find the position of a specific character or word within a double-byte text.
- Double-Byte Character Handling: Perform search operations on text that contains double-byte characters.
Related Functions
SEARCH: Similar toSEARCHB, but does not support double-byte characters.QUERY: Use SQL-like query language to search within data.