The Excel LEFTB function returns the first part of a text string measured in bytes rather than characters. It exists for double-byte character set (DBCS) languages — Japanese, Chinese, and Korean — where each native character counts as 2 bytes when such a language is the system default. Working in English or any other single-byte language? LEFTB behaves exactly like LEFT — just use LEFT. This page is for the byte-counting cases.
Syntax
| Argument | Description | |
|---|---|---|
text | Required | The string to extract from. |
num_bytes | Optional | How many bytes to return, counted from the left. Default is 1. Must be zero or positive. |
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 every character counts as 1 byte and LEFTB returns exactly what LEFT would.
LEFTB vs LEFT: bytes vs characters
On a Japanese-locale system, the string 東京2026 occupies 8 bytes: two 2-byte kanji followed by four 1-byte digits. Watch the two functions diverge:
| A | B | C | |
|---|---|---|---|
| 1 | Text in A2: 東京2026 | Formula | Result (Japanese locale) |
| 2 | byte layout: [2][2][1][1][1][1] | =LEFTB(A2, 4) | 東京 |
| 3 | =LEFT(A2, 4) | 東京20 | |
| 4 | =LEFTB("Dallas", 3) | Dal — same as LEFT |
This is the point of LEFTB: fixed-width files and legacy databases from East Asian systems specify field sizes in bytes, so “the first 10 bytes” is the spec — LEFTB honours it, LEFT can’t.
Try it: char vs byte counter
Type text (mix in some kanji or kana), choose num_bytes, and toggle the system locale to see when LEFTB stops matching LEFT.
Errors & common pitfalls
Pitfall: results depend on the system language, not the workbook. The same =LEFTB(A2, 4) returns 東京 on a Japanese-locale PC and 東京20 on a US-locale PC. If a file travels between offices, byte-based formulas silently change meaning — document the assumption, or avoid B functions in shared files.
Working in English? Use LEFT. On single-byte locales LEFTB adds no capability — it’s LEFT with a misleading name. Reach for LEFT and your formulas stay portable.
Pitfall: cutting a character in half. If num_bytes lands in the middle of a 2-byte character, LEFTB returns a space in its place: =LEFTB("東京", 3) gives 東 followed by a space, never half a kanji. Watch for surprise trailing spaces in concatenations.
#VALUE! — negative num_bytes. num_bytes must be zero or greater. A computed length that goes negative (say, FINDB(...)-2) is the usual culprit — guard it with MAX(0, ...).
Practice workbook
Frequently asked questions
What's the difference between LEFTB and LEFT?
=LEFTB("東京2026", 4) returns just the two kanji while =LEFT(..., 4) returns the kanji plus two digits.Why does LEFTB give me the same answer as LEFT?
When should I actually use LEFTB?
What happens if num_bytes splits a double-byte character?
=LEFTB("東京", 3) returns 東 plus one space (still 2 visible positions). Trim the result if trailing spaces would pollute downstream formulas.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