LEFT and LEFTB Functions

Excel 2007+

Summary

The LEFT function extracts the first characters from a text string based on the specified number, while LEFTB handles byte-based extraction for double-byte character sets. These functions are essential for parsing text data from the left side.

Syntax

LEFT(text, [num_chars])
LEFTB(text, [num_bytes])

Parameters

Parameter Type Required Description
text Text Yes Text string containing the characters to extract from the beginning
num_chars Number No Number of characters to return (≥0). Defaults to 1 if omitted
num_bytes Number No Number of bytes to return for LEFTB (≥0). Defaults to 1 if omitted

Using the LEFT, LEFTB Function

LEFT and LEFTB are powerful text extraction functions that pull characters from the beginning of strings. LEFT uses character count (Unicode-aware in modern Excel), while LEFTB uses byte count for compatibility with double-byte character sets like Japanese.

Common LEFT, LEFTB Examples

Extract Product Code

=LEFT(A2,4)

From 'Sale Price', extracts 'Sale' (first 4 characters)

Single Character Extraction

=LEFT(A3)

From 'Sweden', extracts 'S' (first character, num_chars omitted)

Full String Return

=LEFT("ABC",5)

Returns entire string 'ABC' when num_chars exceeds length

LEFTB Example (DBCS)

=LEFTB(A4,2)

Extracts first 2 bytes for double-byte character compatibility

Frequently Asked Questions

Returns empty string ""

LEFT counts Unicode characters; LEFTB counts bytes (for DBCS legacy support)

LEFTB is deprecated; modern LEFT supports Unicode surrogates via Compatibility Version 2

Common Errors and Solutions

#VALUE! error

Cause: num_chars or num_bytes is negative

Solution: Ensure count parameter is ≥0

Unexpected results with DBCS

Cause: Using LEFT instead of LEFTB with double-byte text

Solution: Use LEFTB for legacy DBCS compatibility

Notes

  • num_chars/num_bytes must be ≥0
  • If omitted, defaults to 1
  • Exceeding string length returns full string
  • LEFTB deprecated but available for backward compatibility
  • Modern Excel LEFT handles Unicode better

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in:

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+