← All functions

LEFTB

Supported, behaves as documented

Category: Text · Last tested 2026-09-01

Real compatibility results for the LEFTB function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.

Support matrix

EngineDocumentedLive-testedVerdict
Excel (desktop)Yes No — documented only n/a
Excel for the web— Yes (recalc, 2026-09-01) Supported, behaves as documented
Google SheetsYes Yes (Drive import, 2026-08-31) Supported, behaves as documented
LibreOffice CalcYes Yes (25.8.7.3, 2026-08-31) Supported, behaves as documented

LibreOffice version history

We executed the same test cases under each LibreOffice release to show exactly when LEFTB’s support changed — not documentation claims, real results.

LibreOffice versionVerdictTested
24.2.0.3 Supported, behaves as documented 2026-08-31
24.8.7.2 Supported, behaves as documented 2026-08-31
25.2.0.3 Supported, behaves as documented 2026-08-31
25.8.7.3 Supported, behaves as documented 2026-08-31

Executed test cases

Excel for the web (executed 2026-09-01 via OneDrive recalculation)

These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.

FormulaDescriptionResultExpectedVerdict
=LEFTB(A2,4) Microsoft's first worked example on the LEFT page, run through the byte-counting spelling Sale Sale
Provenance

The LEFT page publishes =LEFT(A2,4) = Sale for A2 = "Sale Price". "Sale Price" is pure ASCII, so its first four BYTES are its first four CHARACTERS and LEFTB must return the same string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3) The count argument omitted, which the page documents as defaulting to 1 S S
Provenance

The LEFT page documents "If num_chars is omitted, it is assumed to be 1" and publishes =LEFT(A3) = S for A3 = "Sweden". One byte of ASCII is one character. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,99) A count larger than the string, which the page says returns all of it Sweden Sweden
Provenance

The LEFT page documents "If num_chars is greater than the length of text, LEFT returns all of text" -- no padding, no error. "Sweden" is six ASCII bytes, so 99 bytes returns the whole string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,0) A count of zero, the lower end of the documented range
Provenance

The LEFT page documents "Num_chars must be greater than or equal to zero", so zero is inside the valid range and must produce a result rather than an error: zero bytes of text is the empty string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,-1) A negative count, which the documented range excludes #VALUE! #VALUE!
Provenance

The LEFT page documents "Num_chars must be greater than or equal to zero". A negative count is outside that range; #VALUE! is Excel's error for an argument of the wrong kind, and is what the sibling MID/MIDB page states explicitly for its own negative-count case ("If num_chars is negative, MID returns the #VALUE! error value"), so the same code is asserted for the same condition here. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB("EXCEL",2) PROBE: two BYTES of a string made of double-byte characters, where no current rule is published EX
Provenance

This is the one thing LEFTB does that LEFT does not, and it is also the one thing Microsoft no longer documents: the LEFT page's only mention of LEFTB is that it is deprecated. Historically LEFTB counted bytes only when the default language was a DBCS language (Japanese, Chinese, Korean) and behaved exactly like LEFT otherwise -- so under this harness's en_US.UTF-8 environment the two readings give DIFFERENT answers ("E" if bytes are counted, "EX" if characters are), and the documentation does not say which is correct. No expected value is invented. FOR THE RECORD, all four LibreOffice builds return "E", i.e. they count the full-width characters as two bytes each regardless of locale; LENB("EXCEL") is 10 on all four builds against LEN 5, which is consistent.

Ran OK

Google Sheets (executed 2026-08-31 via Drive import)

Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.

FormulaDescriptionResultExpectedVerdict
=LEFTB(A2,4) Microsoft's first worked example on the LEFT page, run through the byte-counting spelling Sale Sale
Provenance

The LEFT page publishes =LEFT(A2,4) = Sale for A2 = "Sale Price". "Sale Price" is pure ASCII, so its first four BYTES are its first four CHARACTERS and LEFTB must return the same string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3) The count argument omitted, which the page documents as defaulting to 1 S S
Provenance

The LEFT page documents "If num_chars is omitted, it is assumed to be 1" and publishes =LEFT(A3) = S for A3 = "Sweden". One byte of ASCII is one character. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,99) A count larger than the string, which the page says returns all of it Sweden Sweden
Provenance

The LEFT page documents "If num_chars is greater than the length of text, LEFT returns all of text" -- no padding, no error. "Sweden" is six ASCII bytes, so 99 bytes returns the whole string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,0) A count of zero, the lower end of the documented range
Provenance

The LEFT page documents "Num_chars must be greater than or equal to zero", so zero is inside the valid range and must produce a result rather than an error: zero bytes of text is the empty string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,-1) A negative count, which the documented range excludes #VALUE! #VALUE!
Provenance

The LEFT page documents "Num_chars must be greater than or equal to zero". A negative count is outside that range; #VALUE! is Excel's error for an argument of the wrong kind, and is what the sibling MID/MIDB page states explicitly for its own negative-count case ("If num_chars is negative, MID returns the #VALUE! error value"), so the same code is asserted for the same condition here. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB("EXCEL",2) PROBE: two BYTES of a string made of double-byte characters, where no current rule is published E
Provenance

This is the one thing LEFTB does that LEFT does not, and it is also the one thing Microsoft no longer documents: the LEFT page's only mention of LEFTB is that it is deprecated. Historically LEFTB counted bytes only when the default language was a DBCS language (Japanese, Chinese, Korean) and behaved exactly like LEFT otherwise -- so under this harness's en_US.UTF-8 environment the two readings give DIFFERENT answers ("E" if bytes are counted, "EX" if characters are), and the documentation does not say which is correct. No expected value is invented. FOR THE RECORD, all four LibreOffice builds return "E", i.e. they count the full-width characters as two bytes each regardless of locale; LENB("EXCEL") is 10 on all four builds against LEN 5, which is consistent.

Ran OK

LibreOffice Calc 25.8.7.3 (tested 2026-08-31)

FormulaDescriptionResultExpectedVerdict
=LEFTB(A2,4) Microsoft's first worked example on the LEFT page, run through the byte-counting spelling Sale Sale
Provenance

The LEFT page publishes =LEFT(A2,4) = Sale for A2 = "Sale Price". "Sale Price" is pure ASCII, so its first four BYTES are its first four CHARACTERS and LEFTB must return the same string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3) The count argument omitted, which the page documents as defaulting to 1 S S
Provenance

The LEFT page documents "If num_chars is omitted, it is assumed to be 1" and publishes =LEFT(A3) = S for A3 = "Sweden". One byte of ASCII is one character. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,99) A count larger than the string, which the page says returns all of it Sweden Sweden
Provenance

The LEFT page documents "If num_chars is greater than the length of text, LEFT returns all of text" -- no padding, no error. "Sweden" is six ASCII bytes, so 99 bytes returns the whole string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,0) A count of zero, the lower end of the documented range
Provenance

The LEFT page documents "Num_chars must be greater than or equal to zero", so zero is inside the valid range and must produce a result rather than an error: zero bytes of text is the empty string. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB(A3,-1) A negative count, which the documented range excludes #VALUE! #VALUE!
Provenance

The LEFT page documents "Num_chars must be greater than or equal to zero". A negative count is outside that range; #VALUE! is Excel's error for an argument of the wrong kind, and is what the sibling MID/MIDB page states explicitly for its own negative-count case ("If num_chars is negative, MID returns the #VALUE! error value"), so the same code is asserted for the same condition here. LEFTB HAS NO PAGE OF ITS OWN ANY MORE. Microsoft's LEFT page -- the page that historically documented LEFT and LEFTB together -- now carries only an Important box reading "The LEFTB function is deprecated. LEFT now supports Unicode surrogates via the Compatibility Version, Version 2", and every worked example and argument rule on it is written for LEFT. LEFTB is still listed as an Excel function, so it is in scope for this corpus, but the only documented behaviour available to assert is the behaviour it shares with LEFT: for text in which every character occupies one byte, a byte count and a character count are the same number, so LEFTB must return what LEFT returns. Those are the cases asserted here, each traced to a specific sentence on the LEFT page. The genuinely byte-specific behaviour -- what happens to double-byte characters, which historically depended on whether the default language was a DBCS language -- is carried as a probe below rather than asserted, because Microsoft no longer publishes a rule for it.

Matched
=LEFTB("EXCEL",2) PROBE: two BYTES of a string made of double-byte characters, where no current rule is published E
Provenance

This is the one thing LEFTB does that LEFT does not, and it is also the one thing Microsoft no longer documents: the LEFT page's only mention of LEFTB is that it is deprecated. Historically LEFTB counted bytes only when the default language was a DBCS language (Japanese, Chinese, Korean) and behaved exactly like LEFT otherwise -- so under this harness's en_US.UTF-8 environment the two readings give DIFFERENT answers ("E" if bytes are counted, "EX" if characters are), and the documentation does not say which is correct. No expected value is invented. FOR THE RECORD, all four LibreOffice builds return "E", i.e. they count the full-width characters as two bytes each regardless of locale; LENB("EXCEL") is 10 on all four builds against LEN 5, which is consistent.

Ran OK

Docs & syntax

Where LEFTB behaves differently