REPLACEB Function
Replaces characters at a byte position with new text.
Category
Text
Available in
All versions, Microsoft 365
Returns
Text
Overview
REPLACEB is the “byte” version of REPLACE. It counts bytes instead of characters — but only when a double-byte language (Japanese, Chinese or Korean) is set as Excel's default editing language. Then each double-byte character counts as 2.
In every other setup, including English, REPLACEB gives exactly the same result as REPLACE. Unless you build workbooks for double-byte systems, use REPLACE.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| old_text | Yes | The original text. |
| start_num | Yes | The byte position to start replacing. |
| num_bytes | Yes | How many bytes to remove. |
| new_text | Yes | The text to put in. |
Examples
Example 1 — Masking digits
Hide four digits in the middle of each account.
| A | B | |
|---|---|---|
| 1 | Account | Masked |
| 2 | ACCT-55120934 | ACCT-****0934 |
| 3 | ACCT-88013377 | ACCT-****3377 |
With English as the default language, =REPLACE(A2, 6, 4, "****") returns the same answers.
Common mistakes
- Results change with language settings. A workbook using REPLACEB can give different answers on a computer whose default language is Japanese, Chinese or Korean. Prefer REPLACE for workbooks you share.
Notes

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.