The Excel LEN function is a Text formula that returns the number of characters in a given string. In this guide, we’re going to show you how to use the Excel LEN function and also go over some tips and error handling methods.


Supported versions

  • All Excel versions

Excel LEN Function Syntax

LEN(text)


Arguments

text

The text that you want to calculate length.



Examples

Basic Use Case

The LEN function requires only a single argument - Enter the text string or the reference that contains the target string to get. For example,

=LEN("2 + 2 equals 5")
formula returns 14 as the formula counts the letters, numbers, symbols, and spaces.

Formatted Strings

The Excel LEN function ignores the number formatting in target cells. Thus, you will get the same number from the same value, even if formatted differently.

 Download Workbook


Tips

  • The Excel LEN function counts space characters.
  • LEN counts decimal separators ("." In US, "," in Europe).
  • Thousand separators are not counted, since they are used for number formatting.
  • Excel evaluates date values as a number, starting from 1. The 1 represents the date 1/1/1900, so a current date like 4/17/2019 is equal to 43572. The LEN function counts the number of digits of the serial number, not formatted date.
  • Note that the TEXT function returns a string that contains currency symbols or thousand separators as characters, not as an element of number formatting. As a result, LEN function counts symbols and thousand separators as well. For example,

=LEN(TEXT(1984.101,"$ #,##0.00")) returns 10 for "$ 1,984.10