Jump to content

Documentation/Calc Functions/LEN

From The Document Foundation Wiki


Function name:

LEN

Category:

Text

Summary:

Determines the number of characters (including spaces) in a supplied text string.

Syntax:

LEN(Text)

Returns:

Returns a non-negative integer that is the number of characters in the supplied string.

Arguments:

Text is a text string (in quotation marks), a number, or a reference to a cell containing one of those types, whose length in characters is to be determined.

Additional details:

None.

Examples:

Formula Description Returns
=LEN("Good afternoon") Here the function returns the length of the string as 14 (single-byte) characters. 14
=LEN("Good afternoon") Here the function returns the length of the string as 14 (double-byte) characters. 14
=LEN(D1) where cell D1 contains the number 12345.67. Here the function returns 8. 8
=LEN("12,345.67") Here the function returns 9. Note that in this case the number is passed as a string - LEN reports an error if the quotation marks are omitted because the number includes a comma digit group separator. 9
=LEN("") Here the function returns 0, since the argument is the empty string. 0

Related LibreOffice functions:

LENB

ODF standard:

Section 6.20.13, part 2

Related (or similar) Excel functions:

LEN