Google Sheets SEARCHB Function

This post will guide you how to use Google Sheets SEARCHB function with syntax and examples.

Description


The Google Sheets SEARCHB function returns the number of the starting location of a substring in a text string counting each double-character as 2. You can use the SEARCHB function to locate a text string within another text string and returns the position of the first character of find_text within text.

The SEARCHB function can be used to calculate the position at which a string is first found within text counting each double-character as 2 in google sheets.  The purpose of this function is to get the location of text in the given string. And it’s returned value as a number representing the location of finding text.

The SEARCHB function is a build-in function in Google Sheets and it is categorized as a Text Function.

Syntax


The syntax of the SEARCHB function is as below:

= SEARCHB(find_text, within_text,[start_num])

Where the SEARCHB function arguments are:

  • find_text -This is a required argument. The substring that you want to find
  • within_text -This is a required argument. The text string in which you want to search for the substring (find_text).
  • Start_num -This is an optional argument. The starting position to search.

Note:

  • The SEARCHB function will return the position of a find_text inside another text string. And if there is more than one occurrence of the find string, and the SEARCHB function returns the position of the first occurrence.
  • If find_text string is not found, the SEARCHB function will return the #VALUE! Error value.
  • When find text string is empty, the SEARCHB function will return 1.
  • If start_num value is omitted, it is set to be 1 by default.
  • The SEARCHB function is not case-sensitive. For example, “google” will match “GOOGLE”. If you wish to compare text where case matters, and you can use the FIND function.
  • The SEARCHB function support wildcard characters.
  • you can use another function called IFERROR function in combination with the SEARCHB function to check for cases when there are any matches to the search.
  • Using SEARCH function for standard character sets and SEARCHB function for double-byte character sets such as Chinese, Japanese, and Korean.

Google Sheets SEARCHB Function Examples


The below examples will show you how to use google sheets SEARCHB function to get the position of substring in a text string.

#1 To get the position of “google” text string in B1 cell, starting at the second position, just using formula:

= SEARCHB(“google”,B1,2) //it returns 7

google sheets searchb function

#2 The search function use wildcard characters to look for a string starts with “go” characters in cell B1, using the following formula:

=SEARCHB(“go*”,B1,1) //it returns 7

google sheets searchb function

#3 #VALUE! Error will be returned if find_text string is not found in with_text:

=SEARCH(“test”,”google”,1)   //it returns #VALUE!

google sheets searchb function

#4 to get the position of a double-byte character sets “新“ within another Chinese text string, using the following formula:

=SEARCHB("新", "农历新年", 2) //it returns 5

google sheets searchb function

 

 

 

 

 

Related Posts

Google Sheets NOW Function
google sheets now function1

This post will guide you how to use Google Sheets NOW function with syntax and examples. Description The Google Sheets NOW function returns the serial number of the current date and time. And it will be updated each time when ...

Google Sheets NETWORKDAYS.INTL Function
google sheets networkdays.intl function1

This post will guide you how to use Google Sheets NETWORKDAYS.INTL function with syntax and examples. Description The Google Sheets NETWORKDAYS.INTL function returns the number of net working days between tow given days excluding specified weekend days and holidays. The ...

Google Sheets NETWORKDAYS Function
google sheets networkdays function1

This post will guide you how to use Google Sheets NETWORKDAYS function with syntax and examples. Description The Google Sheets NETWORKDAYS function returns the number of net working days between tow given days. The NETWORKDAYS function can be used to ...

Google Sheets MONTH Function
google sheets month function1

This post will guide you how to use Google Sheets MONTH function with syntax and examples. Description The Google Sheets MONTH function returns the month of a date represented by a serial number. And the month is an integer number ...

Google Sheets MINUTE Function
google sheets minute function1

This post will guide you how to use Google Sheets MINUTE function with syntax and examples. Description The Google Sheets MINUTE returns the minutes of a time value. And the minutes is an integer number from 0 to 59. So ...

Google Sheets ISOWEEKNUM Function
google sheets isoweeknum function1

This post will guide you how to use Google Sheets ISOWEEKNUM function with syntax and examples. Description The Google Sheets ISOWEEKNUM returns the number of the ISO week of the year for a given date. ISO weeks begin on Monday ...

Google Sheets HOUR Function
google sheets hour function1

This post will guide you how to use Google Sheets HOUR function with syntax and examples. Description The Google Sheets HOUR returns the hour of a time value. Or returns an integer value that represent the hour component of a ...

Google Sheets EOMONTH Function
google sheets eomonth function1

This post will guide you how to use Google Sheets EOMONTH function with syntax and examples. Description The Google Sheets EOMONTH returns a date representing the last day of the month, n months in the future or past. The EOMONTH ...

Google Sheets EDATE Function
google sheets edate function1

This post will guide you how to use Google Sheets EDATE function with syntax and examples. Description The Google Sheets EDATE returns a date that is a specified number of months before or after a specified date. You can use ...

Google Sheets DAYS360 Function
google sheets days360 function1

This post will guide you how to use Google Sheets DAYS360 function with syntax and examples. Description The Google Sheets DAYS360 will calculate the number of days between two dates based on a 360-day year. The DAYS360 function can be ...

Sidebar