LEN Function in Google Sheets: Explained
In this article, you will learn how to use the LEN formula in Google Sheets.
How does the LEN function work in Google Sheets
The LEN formula counts the number of characters in a given text string. The LEN function is useful when you simply count the number of letters in a cell or check whether the number of characters in a cell meets the maximum or minimum requirements.
How to use the LEN function in Google Sheets
- Type “=LEN” or go to “Insert” → “Function” (or directly navigate to the “Functions” icon) → “Text” → “LEN”.
- Input a decimal Unicode by manual input or cell reference.
- Press the “Enter” key.
The general syntax is as follows:
Text: a text string whose number of characters to be counted
Note: The LEN function counts all characters, including spaces. If you have unexpected values returned by the LEN formula, ensure you don’t have such special letters in the original text strings. When you input text manually, don’t forget to enclose them with quotation marks.
Look at the following examples in the screenshot. As you can see, it is simple to use this formula. Once you input text or select a cell containing a text string, the LEN function immediately returns the number of characters in the chosen text.
As we mentioned at the beginning of this article, you can leverage this function to confirm if a specific text meets a criterion on character count or not. Assume you want to test if each text string includes ten or more characters. You can use the IF function with the LEN function in the following steps.
- Enter text strings whose number of characters you want to check (shown in Column B)
- Count the number of characters in each text by the LEN function (shown in Column C)
- Check whether the returned number for each text is ten or over by the IF function (shown in Column D)
In the upper table, you have three columns (Columns B to D), “Text string”, “Outcome”, and “Test (Min: 10)”, which correspond to each step above. However, as seen in the lower table, you can combine the two formulas by incorporating the LEN function in the IF function.