The LEN function can be used to count the number of characters in a cell.
It can count text, numbers, special characters, non-printable characters, and spaces from a cell.
In the below example, we have used LEN function to count mobile number digits. As I have 10 digits in the cell, it has return 10 in the result.
- text A text string for which you want to count the characters.
In the below example, we have used LEN function to count letters in a cell. “Hello, World” has 10 letters with a space between and I got 11 in the result.
In the below example, “22-Jan-2016” has 11 characters, but LEN function returns 5.
The reason behind it is that LEN function counts the characters in the value of a cell and not concerned with formatting.
- It will only count the characters as per the actual values in the cell. Any formatted character like “$” will not consider as a character.
- If you refer to an array range it will return the result in an array.
- If a cell is blank it will return 0 in the result.
- If a cell has an error value it will return that error in the result.
- You can also insert a text string directly into the function to count the length of the string.
- If you try to refer to more than one cell, It will return #VALUE!.