SEARCHB function
SEARCHB finds where one piece of text appears inside another, counting in bytes. It differs from SEARCH only in East Asian (double-byte) language settings, where it counts differently.
Example
A
B
C
D
1
3
2
3
Syntax
SEARCHB(find_text, within_text, [start_num])
Arguments in [square brackets] are optional.
-
find_text(required) - The text to find.
-
within_text(required) - The text to search in.
-
start_num(optional) - Byte position to begin; default 1.
Returns: The byte position of the first match.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=SEARCHB("b","abc") | 2 | Single-byte text |
=SEARCHB("c","日本c") | 3 | After double-byte characters |
Watch out for
- Same as SEARCH in non-double-byte settings.
Where it works
- Excel
- SEARCHB is in every version of Excel from 2007 on. Differs from the non-B version only in East Asian (double-byte) language settings.
- Google Sheets
- No direct equivalent. Use SEARCH.
Part of Text functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .