Get the length of text.
=LEN(text)
| Parameter | Description |
|---|---|
text |
The text for which to calculate length. |
LEN returns the count of characters in a text string:
=LEN("apple") // returns 5
Space characters are included in the count:
=LEN("apple ") // returns 6
LEN also works with numeric values, but number formatting is not included:
=LEN(1000) // returns 4
=LEN($1,000) // returns 4
The LEN function often appears in other formulas that manipulate text in some way. For example, it can be used with the RIGHT and FIND functions to ex
=RIGHT(A1,LEN(A1)-FIND(char,A1)) // get text to right of char
For some characters, the LEN function returns the number of UTF-16 code units used to encode the string rather than the number of user-perceived chara
=LEN("🙂") // returns 2
Characters in the Basic Multilingual Plane (U+0000 to U+FFFF), like basic letters (A-Z) and symbols like π (U+03C0) and ✓ (U+2713), are encoded with o
=LEN("π") // returns 1