Syntax
LEN(text)
LENB(text)
Definition. The LEN() function returns the number of characters in a string. The LENB() function returns the number of bytes for the double-byte characters in a string.
Arguments
text (required). The text whose length you want to determine.
Background. This function can be used for many tasks; for example, you could use the function together with other functions such as MID(), LEFT(), or RIGHT() to manipulate a string.
You can use this function to check whether an entry has a certain length. You can also check whether the content in text columns exceeds a given length. The function counts spaces and numerals as characters.
Example. Assume that you need to make sure that the interface descriptions in a column don’t exceed 10 characters. To do this, you use the LEN() function. With the AutoFilter, you can quickly find and correct strings longer than 10 characters in the result column. Some other examples are listed here:
=LEN("CD")
returns 2
.
=LEN("Excel 2007")
returns 10
.
=LEN("Microsoft")
returns 9
.
=LEN("No Panic!")
returns 9
.
=LEN("")
returns 0
.
=LEN(" ")
returns 1
.
=LEN("1.345 $")
returns 7
.
=LEN(TODAY())
returns 5
.