An Overview of LEN Function | Microsoft Excel
Objectives
The LEN function determines the length of a text string. It returns the length of the string as the number of characters.
Syntax
=LEN(text)
Arguments
- text: Compulsory. It refers to the string whose length you want to determine.
Output
Returns the length of the string as the number of characters.
Examples of LEN Function
Suppose, you have a string “John Doe” in cell A2. Now you want to find its length. To do that you can use the LEN function. The formula for this will be :
=LEN(A2)
The output will be 8.
Here are some examples of the usage of the LEN function.
Usage Guide of LEN Function
Step_1: Start with inserting an equal sign (=) in a blank cell.
Step_2: Then type LEN.
Step_3: Type open parenthesis “(“.
As you type the open parenthesis, Excel shows the syntax of the LEN function.
Step_4: Insert the string whose length you want to determine.
You can directly insert a string into the function. If you want the string to be John Doe, you have to type John Doe inside a pair of double inverted commas like “John Doe”.
You can also insert a cell address that contains a string.
Here, I’m inserting A2 which has the string, John Doe.
Step_5: Insert the closing parenthesis “)”.
Step_6: Finally, hit the ENTER button to insert the formula inside the cell.
Final Result
The LEN function returns 8. Here, the value of text is John Doe. There are 7 LETTERS and 1 SPACE in John Doe. “SPACE” also counts as a character. So, the length of text is 8.
Availability
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remarks
- The LEN function counts LETTERS, NUMBERS, COMMA, SPACE, NEGATIVE SYMBOL(-), DECIMAL SEPARATOR(.), and other SPECIAL CHARACTERS as characters. But NUMBER FORMATTING is not included.
- It returns 0 when the value of the text is empty.
- The LEN function is not case-sensitive.
- It treats DATES as a 5-digit serial number.
- The LEN function can only be used to calculate the length of a text string that is up to 32,767 characters long.
- It can be used in combination with other functions, such as LEFT, RIGHT, and MID, to extract a specific number of characters from a text string.
Conclusion
The LEN function is one of the text functions in Excel. If you have any questions regarding the LEN function, please comment below. Thanks!