The Excel LEN function returns the length (number of characters) of a given text.



Argument Argument description
1TextThe text to return the number of characters of.

Example: Simple Len formula

To use the LEN function, just insert a text that you want to count the characters of.

Spreadsheet editor


The Len function counts the number of characters in the Text column. The text Example text consists of 12 characters (space included). And SpreadsheetCenter.com consists of 21 characters in total.

Note: Numbers and Number Formatting

The Len function can be used to determine the number of characters in a number. Like so:

=LEN(123) = 3

Other characters that are used in numbers, like commas, periods or minus signs are also taken into account:

=LEN(-0.5) = 4

So the minus – and the period . are added to the total number of characters as well in this example. Something that’s not taken into account is number formatting, so for example:

Using the Len function on a number formatted as currency.

The dollar sign $ and all other number formatting (commas and periods included) are not counted towards the total number of characters.


What’s the result of Len on an empty text?

0, as you’d probably expect.

Are spaces included in the count of Len?

Yes, all spaces are counted. So that also includes any spaces before and after texts.

​Get Good at Excel on Autopilot

Sign up to our newsletter and receive ​Excel articles, tips and tricks delivered straight to your inbox. All you have to do is read them! ​Plus, to get you started, you'll receive a PDF with 200+ Excel shortcuts.