Please note javascript is required for full website functionality.

Blog

A to Z of Excel Functions: The LENB Function

20 September 2021

Welcome back to our regular A to Z of Excel Functions blog. Today we look at the LENB function.


The LENB Function

The LENB function returns the number of bytes used to represent the characters in a text string.  It employs the following syntax to operate:

LENB(text)

The LENB function has the following argument:

  • text: this is required and represents the text string whose length you wish to ascertain.

It should be further noted that:

  • spaces count as characters in text
  • this function may not be available in all languages.  LENB counts two (2) bytes per character only when a DBCS language is set as the default language (the languages that support DBCS include Japanese, Chinese (Simplified), Chinese (Traditional), and Korean
  • otherwise, LENB behaves the same as LEN, counting one (1) byte per character.

For example, =LENB("中国香港") is equal to 8 only when a DBCS language is set as the default language; otherwise, it will return 4.  However, =LEN("中国香港") is equal to 4 no matter what the default language setting is on your computer.

We’ll continue our A to Z of Excel Functions soon.  Keep checking back – there’s a new blog post every business day.

A full page of the function articles can be found here.

Newsletter