How to use LEFT, LEFTBs function in Excel?

In Excel, the `LEFT` and `LEFTB` functions are used to extract a specified number of characters from the beginning (left side) of a text string. Here’s how you can use each of these functions:

LEFT Function

The `LEFT` function is primarily used for text in a language where each character is considered a single unit (such as English).

Syntax:

LEFT(text, [num_chars])
  • `text`: The text string from which you want to extract characters.
  • `[num_chars]`: (Optional) The number of characters you want to extract. By default, if you omit this argument, it will extract just the first character.

Example:

  =LEFT(A1, 5)
  • If you have “Hello, World!” in cell A1:

This formula would return “Hello”.

LEFTB Function

The `LEFTB` function is similar to the `LEFT` function but is used for languages that use the double-byte character set (DBCS), like Chinese, Japanese, or Korean. It operates based on bytes instead of characters.

Syntax:

LEFTB(text, [num_bytes])
  • `text`: The text string from which you want to extract characters.
  • `[num_bytes]`: (Optional) The number of bytes you want to extract, where DBCS characters are two bytes and ASCII characters are one byte.

Example:

  =LEFTB(A1, 3)
  • If you have a DBCS text in cell A1 and you want to extract the first three bytes:

The number of characters returned may be different from the LEFT function, depending on the text and the language setting.

Important Notes:

  • Excel Language Setting: `LEFTB` will only behave differently from `LEFT` if you’re using a language setting that supports DBCS; otherwise, it behaves like `LEFT`.
  • Selecting Correct Function: Use `LEFT` for single-byte character languages and `LEFTB` for DBCS languages if you require precision with bytes.

By understanding these functions, you can efficiently manipulate and extract parts of text strings in Microsoft Excel based on your language setup and needs.

Unlock Your Potential

Excel

Basic - Advanced

Access

Access Basic - Advanced

Power BI

Power BI Basic - Advanced

Help us grow the project