<< Go back to all functions

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 within text_to_search.
  • text_to_search: The text within which to search for the search_for string.
  • starting_at: [Optional] The position within text_to_search where the search should start. If omitted, the default is 1 (the first character).

Step-by-Step Tutorial

  1. Using SEARCHB to find the position of a string within text:

    • Example: =SEARCHB("world", "Hello world")
    • Result: 7
  2. Using SEARCHB with a starting position:

    • Example: =SEARCHB("world", "Hello world", 8)
    • Result: 0 (since the search is started from position 8 where "world" is not found)

Use Cases and Scenarios

  1. Language Processing: Find the position of a specific character or word within a double-byte text.
  2. Double-Byte Character Handling: Perform search operations on text that contains double-byte characters.

Related Functions

  • SEARCH: Similar to SEARCHB, but does not support double-byte characters.
  • QUERY: Use SQL-like query language to search within data.

Related Articles