Excel - LENB Function



LENB Function

The EXCEL LENB function returns the number of bytes employed by each character in the string, countable as 2 for each character. However, this function is not compatible with all languages. To implement this powerful function, you must change the preferred language to a DBCS-aided language like Japanese, Korean, and Chinese. If Microsoft Excel is set to an SBCS language like English, the LENB function will act like the LENB function, and the same result will be retrieved.

Compatibility

This advanced Excel function is compatible with the following versions of MS-Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016

Syntax

The syntax of the LENB function is as follows −

=LENB(text)

Argument

You can use the following arguments with the LENB function −

Argument Description Required / Optional
text It specifies the text to find out its length. Empty spaces are countable as characters. Required

LENB Function in Microsoft Excel

  • Expediate the Excel sheet and double-click on the designated cell.
  • Write the =sign and LENB(cell reference/ text and then enclosed the bracket).
  • Finally, hit the Enter button.

A few interesting examples of the LENB function are written below −

Examples of LENB Function

Practice the following example to learn the use of the LENB function in Excel.

Example 1

Evaluate the length of the Employee name using the LENB function.

Step 1 − First, consider the sample datasets where employee names are specified in column A.

LENB Function in Excel

Step 2 − Enter the formula =LENB(A2) in the B2 cell and press the Enter tab.

LENB Function in Excel 1

Therefore, the LENB function will return the value of 12.

LENB Function in Excel 2

Step 3 − Furthermore, drag the + sign at the right lower corner of the B2 cell and place it into the B7 cell to calculate the length of the remaining cell range A2:A7.

LENB Function in Excel 3

Note − Since we are using SBCS(English), you may also employ the LEN function, which gives you a similar result.

Example 2

Calculate the length of the text string Using Mixed set of language.

Solution

Step 1 − Consider the sample dataset where the B2 cell contains the words consisting of the English and Korean languages.

LENB Function in Excel 4

Step 2 − After that, enter the formula =LENB(B2) in the C2 cell and press the Enter tab.

LENB Function in Excel 5

Therefore, the LENB function will retrieve the length 14 of the given text string.

LENB Function in Excel 6

Download Practice Sheet

You can download and use the sample data sheet to practice the LENB function.

Advertisements