If you need to find the length of a string in Microsoft Excel, you can use the LEN function. This function takes a string as input and returns the length of that string. To use the LEN function, first select the string you want to measure. Next, enter the LEN function into the cell where you want it to appear. The LEN function will return the length of that string. ..


If you’ve ever wanted to try and find the number of characters in a line of text, you can use Microsoft Excel to do so, thanks to the LEN function. Here’s how to use it.

What Is the LEN Function?

The LEN function is a simple calculation function that counts all the characters in a given text string, including numbers, letters, special characters, and spaces. The function name (LEN) is shorthand for length, as the function output provides the total length of a text string as a number.

To give you an example, let’s assume that an Excel workbook contains a cell with the following text:

The text string contains spaces, text, numbers, and a special character, and has a length of 56 characters. Should you wish to confirm this calculation, you could use LEN to do so.

How to Use the LEN Function in Microsoft Excel

Unlike other Excel functions, the LEN function is extremely simple to use. It contains only one argument—the text string that you wish to calculate. You can either place this in the formula directly, or you can refer to a cell that contains the text string.

For example, the following formula calculates the length of a text string contained in cell A1. If you wish to use this formula yourself, replace the cell reference with your own.

As previously mentioned, you can also use LEN to calculate the length of a text string written into the formula directly using the example formula below.

You can replace the example text with your own, but you’ll need to surround the text string in quote marks. Alternatively, place the text in a separate cell (without quote marks), then use the cell reference for that cell in your formula to determine the length instead.

RELATED: Useful Functions You Should Get to Know