ID EN
#Text

LEN

Excel Functions

Get the length of text.

Syntax

EXCEL
=LEN(text)

Arguments

Parameter Description
text The text for which to calculate length.

Return Value

Number of characters

Details

The LEN function returns the number of characters in a given text string. LEN takes just one argument, text. LEN counts the number of characters in text, including space and punctuation, and returns a number as the result. If text is an empty string ("") or text is a reference to an empty cell, LEN returns zero. LEN will also count characters in numbers, but number formatting is not included. LEN returns the count of characters in a text string: Space characters are included in the count: LEN also works with numeric values, but number formatting is not included: 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 extract text to the right of a given character:

Examples

Examples

LEN returns the count of characters in a text string:

EXCEL
=LEN("apple") // returns 5
Examples

Space characters are included in the count:

EXCEL
=LEN("apple ") // returns 6
Examples

LEN also works with numeric values, but number formatting is not included:

EXCEL
=LEN(1000) // returns 4
=LEN($1,000) // returns 4
Examples

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

EXCEL
=RIGHT(A1,LEN(A1)-FIND(char,A1)) // get text to right of char
Technical Notes

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

EXCEL
=LEN("🙂") // returns 2
Technical Notes

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

EXCEL
=LEN("π") // returns 1

See Also

RIGHT LEFT MID