The Excel SEARCHB function locates one text string inside another — ignoring case and accepting wildcards — and returns the position of the match’s first byte. It is the byte-counting twin of SEARCH, built for double-byte character set (DBCS) languages — Japanese, Chinese, and Korean — where each native character occupies 2 bytes when such a language is the system default. Working in English or any other single-byte language? SEARCHB behaves exactly like SEARCH — just use SEARCH.
Syntax
| Argument | Description | |
|---|---|---|
find_text | Required | The text to look for. Not case-sensitive. Wildcards allowed: ? = any one character, * = any run of characters; escape a literal with ~. |
within_text | Required | The string to search inside. |
start_num | Optional | The byte position to start searching from. Default is 1. |
Available in: all Excel versions. Byte counting activates only when a DBCS language (Japanese, Chinese Simplified/Traditional, or Korean) is the system default language; otherwise positions are character positions and SEARCHB returns exactly what SEARCH would.
SEARCHB vs SEARCH: byte positions, forgiving matches
On a Japanese-locale system, "Tower" in 東京Tower starts at character 3 but byte 5 — and SEARCHB happily matches the lowercase query:
| A | B | C | |
|---|---|---|---|
| 1 | Text in A2: 東京Tower | Formula | Result (Japanese locale) |
| 2 | byte positions: 東=1–2, 京=3–4, T=5 | =SEARCHB("tower", A2) | 5 |
| 3 | =SEARCH("tower", A2) | 3 | |
| 4 | =SEARCHB("t?w", A2) | 5 — wildcards work |
Wildcards make SEARCHB the flexible one of the byte pair — locate a pattern, then slice with MIDB:
Searching for a literal question mark or asterisk? Escape it with a tilde: ~? or ~*.
Try it: char vs byte position finder
Type a string and a search term (case doesn’t matter), then toggle the system locale to see character and byte positions drift apart.
Errors & common pitfalls
Pitfall: byte positions into character functions. A SEARCHB result belongs to MIDB, LEFTB, RIGHTB, or REPLACEB. Feed it to MID or REPLACE and the cut lands mid-word on DBCS text. Match B with B.
Pitfall: results depend on the system language. The same SEARCHB formula returns different numbers on a Tokyo machine and a Dallas machine — byte counting follows the system locale, not the workbook. Document the assumption in shared files.
Working in English? Use SEARCH. On single-byte locales SEARCHB is SEARCH with a longer name. Keep formulas portable.
#VALUE! — no match found. Unlike FINDB, capitalization is never the culprit — check for typos, or remember that ? and * are wildcards here: search for ~? to find a real question mark. Wrap with IFERROR for clean output.
Practice workbook
Frequently asked questions
What's the difference between SEARCHB and SEARCH?
What's the difference between SEARCHB and FINDB?
? and * wildcards; FINDB matches exact case and treats every character literally. Both return byte positions.Why does SEARCHB give me the same answer as SEARCH?
How do wildcards work in SEARCHB?
? matches any single character and * matches any run of characters (including none) — =SEARCHB("t?wer", A2) finds “tower” or “tAwer”. To search for a literal ? or *, prefix it with a tilde: ~?, ~*, and ~~ for a real tilde.Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class