To measure the length of any character string, use the LEN function in Excel. This function precisely returns the exact length of the character string, allowing you to fulfill your specific requirements. To gain a deeper understanding of the syntax and usage of the LEN function, follow this article.
LEN Function and Examples
Guide on Using LEN Function in Excel - Illustrated Examples
Syntax: LEN(text)
Where: Text is the character string
Function: Returns the length of the character string, including spaces.
Example 1: Measure the length of the string “University of Da Nang”.
The formula would be: =LEN(“University of Da Nang”) = 21.
Example 2: Retrieve the middle value from the “Student ID” column to populate the “Number” column. Apply 2 functions, MID and LEN.
- Observing that the first 2 characters and the last 2 characters are letters, cut the string from position 3, and take the number of characters equal to the length of the string minus 4. The formula is: =MID(D6, 3, LEN(D6) – 4).
- Drag down to other cells to copy the formula. The result is:
Through this article, you've learned the function of the LEN function for measuring the length of a character string and how to apply it in specific cases. Besides LEN, there are many other string manipulation functions like: RIGHT function for cutting characters from the right, MID function for cutting characters in the middle, ...