Returns the length of a string in bytes." Learn more.
In Google Sheets, the LENB function is used to count the number of bytes in a given text string. The "B" in LENB stands for "bytes."
This function is specifically designed to handle double-byte characters, which are commonly used in languages such as Chinese, Japanese, and Korean.
The syntax for the LENB function is as follows:
LENB(string)
Here, "string" refers to the text or cell reference that you want to count the bytes for. The function returns the number of bytes in the given string.
Each double-byte character is counted as two bytes, while single-byte characters are counted as one byte.
It's important to note that the LENB function counts bytes, not characters.
Depending on the character encoding used, some characters may occupy more than one byte.
So, if you're working with multibyte characters, using LENB can give you a more accurate count of the data size.