Excel Function Reference

LEN

Counts how many characters are in text, spaces included. Helps check the length of a code or spot extra spaces.

LEN(text)
text
The cell or text to count characters in.

Return value

A number: how many characters are in the text, spaces included.

Examples

Checking phone numbers

fx
A
B
C
1
2
3
4
5
6
7
Phone (digits only)
Digits
5402123456
7712345678
660123456
6155012345
Sheet1

Details

LEN counts every character: letters, digits, spaces and punctuation.

It's most often used to check data. A US phone number has exactly 10 digits, and if LEN shows a different number, the cell has a mistake.

LEN looks at the value itself, not at how it's displayed. The number 1290 formatted as "$1,290" has a length of 4.

Common mistakes

  • Invisible spaces count too. If the length is more than expected, check the edges of the cell.
  • For a date, LEN counts the digits of the number the date is stored as, not what you see on the screen.
  • A code with a leading zero was entered as a number: the zero disappeared, and LEN shows one digit less.

See also

Where to learn