The Excel RIGHTB function returns the last part of a text string measured in bytes rather than characters. Like the rest of Excel’s B functions 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? RIGHTB behaves exactly like RIGHT — just use RIGHT.
Syntax
| Argument | Description | |
|---|---|---|
text | Required | The string to extract from. |
num_bytes | Optional | How many bytes to return, counted from the right end. 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 RIGHTB returns exactly what RIGHT would.
RIGHTB vs RIGHT: bytes vs characters
On a Japanese-locale system, 2026東京 occupies 8 bytes — four 1-byte digits then two 2-byte kanji. Asking both functions for “4” from the right shows the difference:
| A | B | C | |
|---|---|---|---|
| 1 | Text in A2: 2026東京 | Formula | Result (Japanese locale) |
| 2 | byte layout: [1][1][1][1][2][2] | =RIGHTB(A2, 4) | 東京 |
| 3 | =RIGHT(A2, 4) | 26東京 | |
| 4 | =RIGHTB("Dallas", 3) | las — same as RIGHT |
RIGHTB earns its keep with byte-defined suffix fields in legacy East Asian data — the last N bytes of a record, as the file spec defines them:
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 RIGHTB stops matching RIGHT.
Errors & common pitfalls
Pitfall: results depend on the system language, not the workbook. =RIGHTB(A2, 4) returns two kanji on a Tokyo PC and four characters on a Dallas PC. Byte-based formulas change meaning when the file changes machines — a quiet way for shared workbooks to disagree.
Working in English? Use RIGHT. On single-byte locales RIGHTB is just RIGHT in disguise. RIGHT keeps your formulas portable and your intent obvious.
Pitfall: cutting a character in half. If num_bytes lands mid-character, the orphaned half arrives as a space: =RIGHTB("東京", 3) returns a space followed by 京. A surprise leading space is RIGHTB’s signature glitch — TRIM if in doubt.
#VALUE! — negative num_bytes. A computed count that dips below zero — typically LENB(A2)-FINDB(...) arithmetic — fails. Guard with MAX(0, ...).
Practice workbook
Frequently asked questions
What's the difference between RIGHTB and RIGHT?
=RIGHTB("2026東京", 4) returns just the two kanji while RIGHT returns four characters.Why does RIGHTB give me the same answer as RIGHT?
When should I actually use RIGHTB?
What happens if num_bytes splits a double-byte character?
=RIGHTB("東京", 3) returns a space then 京, never half a kanji. Wrap the result in TRIM if a leading space would break comparisons downstream.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