MIDB Function

Returns characters from the middle of text, with positions counted in bytes.

Category

Text

Available in

All versions, Microsoft 365

Returns

Text

Want to practice MIDB in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

MIDB is the “byte” version of MID. 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, MIDB gives exactly the same result as MID. Unless you build workbooks for double-byte systems, use MID.

Syntax

=MIDB(text, start_num, num_bytes) Explain

Arguments

ArgumentRequired?What it does
textYesThe text to extract from.
start_numYesThe byte position to start at.
num_bytesYesHow many bytes to return.

Examples

Example 1 — Product number

The product number starts at position 4 and is 4 long.

B2fx=MIDB(A2, 4, 4)
AB
1SKUProduct
2NS-1042-BLU1042
3NS-2210-RED2210
=MIDB(A2, 4, 4) Explain

With English as the default language, =MID(A2, 4, 4) returns the same answers.

Common mistakes

  • Results change with language settings. A workbook using MIDB can give different answers on a computer whose default language is Japanese, Chinese or Korean. Prefer MID for workbooks you share.

Notes

Kyle Stott

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.