LEN

Formulas / LEN
Calculates the length of any text string
=LEN(cell)
  • text - the text to find the length of

Examples

  • =LEN("apple")

    In this example, LEN returns 5 because the string "apple" has five characters.

  • =LEN("apple ")

    This time, LEN returns six characters because the string "apple " has six characters, including the space at the end.

  • =LEN(1000)

    This is an example of the LEN function with a number. The function returns 4 because the string 1000 has four characters.

  • =LEN($1,000)

    This is an example of the LEN function with number formatting. The function returns 4 because LEN counts $1,000 without number formatting and "1000" has four characters.

Summary

The LEN function is used to count the number of characters in a string, including numerical characters. It does not include number formatting and only takes one argument, which is the text to count.

  • The LEN function returns the length of a string as the number of characters and includes spaces and punctuation.
  • LEN does not count number formatting in its calculation.
  • The LEN function usually appears with other functions that manipulate text.
  • The LEN function returns zero for empty values.


Frequently Asked Questions

What does the LEN function do?
The LEN function computes how many characters there are in a string of text.
Does the LEN function work in all languages?
No, the LEN function does not work in all languages.
How does the LEN function work when the default language is DBCS?
When the default language is DBCS, the LEN function counts 1 byte per character.
How does the LEN function work when the default language is not DBCS?
The LEN function works the same as LENB when the default language is not DBCS.
Does the LEN function count spaces as characters?
Yes, the LEN function counts spaces as characters.

Make Better Decisions
With Data

Analyze data, automate reports and create live dashboards
for all your business applications, without code. Get unlimited access free for 14 days.