Excel - SEARCHB Function
SEARCHB Function
The EXCEL SEARCHB function retrieves the index position of the character presented in another text string. The main feature of the SEARCHB function is that it calculates each character as a 2-byte and is supported by East Asian languages like Chinese, Korean, etc. You must alter the preferred language settings to DBCS-aided languages to execute this eminent function successfully. Unlike the FINDB function, the SEARCHB function is case-insensitive.
Compatibility
The SEARCHB function is compatible with multiple versions of the MS-Excel −
- Excel for Microsoft 365
- Excel for Microsoft 365 for Mac
- Excel for the web
- Excel 2024
- Excel 2024 for Mac
- Excel 2021
- Excel 2021 for Mac
- Excel 2019
- Excel 2016
Syntax
The Syntax of the SEARCHB function is as follows −
=SEARCHB(find_text,within_text,[start_num])
Arguments
You can utilize the following arguments with the SEARCHB function −
| Argument | Description | Required / Optional |
|---|---|---|
| find_text | It indicates the character/text that would be extracted from the within_text argument. | Required |
| within_text | It specifies another string upon which the part of the string will be searched. | Required |
| [start_num] | It denotes the character's starting position from where the searching process will begin. | Optional |
Points to Remember
- If the text specified in the find_text is not presented in the within_text argument, then the SEARCHB function will retrieve the #VALUE! error.
- The wildcard characters (* and ?) can be utilized in the find_text argument.
- By default, the start_num argument is equal to 1, which means text is searched from left to right in the input string.
- The start_num argument contains a negative value or is more significant than the within_text arguments length; then the SEARCHB function will retrieve the #VALUE! error.
Examples of SEARCHB Function
Practice the following example to learn the use of the SEARCHB function in Excel.
Example 1: Using Japanese Language
In this example, the preferred language settings of Excel is Japanese.
Solution
Step 1 − First, assume the sample dataset where the Japanese translation of the text string World game changer is given in the B4 cell and the Cricket game text string conversion in the Japanese is written in the B5 cell.
Step 2 − After that, write the formula =SEARCHB("",B4) in the C4 cell.
Once you press the Enter tab, the SEARCHB function returns the index position of the in the input string which is 21.
Step 3 − Moreover, double click on the C5 cell and type the formula =SEARCHB("",B5,4). In this formula, the start_num value is 4 that means searching of the character will begin from the fourth position of the input string whose cell reference is B5.
Furthermore, press the Enter tab to get the position of the character.
NOTE − All these characters in the input string are double byte characters string. If you try to execute the SEARCH function for these input text value, then the SEARCH function will give you different output.
Example 2
If the text specified in the find_text is not presented in the within_text argument, then the SEARCHB function will retrieve the #VALUE! error.
Solution
Write the formula =SEARCHB("",B3) in the C3 cell and press the Enter tab.
Hence, the SEARCHB function will gives you the #VALUE! error as the character defined in the find_text is missing in the given string.
Example 3
The start_num argument contains a negative value or is more significant than the within_text arguments length; then the SEARCHB function will retrieve the #VALUE! error.
Solution
You can write the formula =SEARCHB("",B3,-8) in the C3 cell. As you notice in this formula, the third argument is not positive.
Therefore, the SEARCHB function will retrieve the #VALUE! error.
Download Practice Sheet
You can download and use the sample data sheet to practice the SEARCHB function.