Text
LEN
Definition
LEN returns the number of characters in a text string, counting spaces.
Syntax
=LEN(text)
Arguments
| Argument | Meaning |
|---|---|
text |
The text, or the cell holding it, to measure. |
Worked example
A sign-up form limits usernames in length, so you measure the entries in A2:A4.
| A: Username |
|---|
| ember_fox |
| tidepool |
| kiwi99 |
Formula: =LEN(A2)
Result: 9. ember_fox has nine characters, and the underscore counts as one of them.
Practice
Cell A2 holds the phrase good morning, with one space between the words. Write a formula that returns its length.
- In B2, write a LEN formula for A2.
- B2 should show the length of A2.
Step 1 of 2
Enter =LEN(A2) in B2.
A2 is good morning, including the space, so the length is 12.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
B2 uses LEN.
B2 now shows 12.
Related functions
LEN counts characters, and LEFT uses a character count to cut the start of a text, so the two work well together.
Common mistake
Forgetting that spaces count, so a name with an invisible trailing space reports one more character than the letters you can see.