How to count characters in Excel

One of the Excel questions we get asked the most is how to count the number of characters in a given cell. There’s a very simple solution to this problem: the LEN function.

Calling the LEN function on any string of text returns the number of characters in that string. For example, consider the following formula:

=LEN("It works!")
Output: 9
The LEN function is generally simple, but does have a couple of intricacies when dealing with formatted fields like dates. For more information, check out our LEN function tutorial.

Excluding spaces from your character count

In some situations, you may want to exclude spaces from your character count. To do so, use the SUBSTITUTE function to replace spaces (or any other character you desire) before calling LEN:

=LEN(SUBSTITUTE("It works!"," ",""))
Output: 8

In the example above, we use SUBSTITUTE to replace all spaces (" ") with the blank character ("") before calling LEN. We call LEN on the resulting phrase, "Itworks!" — with no spaces — resulting in output of the number 8.

Save an hour of work a day with these 5 advanced Excel tricks

Work smarter, not harder. Sign up for our 5-day mini-course to receive must-learn lessons on getting Excel to do your work for you.

  • How to create beautiful table formatting instantly...
  • Why to rethink the way you do VLOOKUPs...
  • Plus, we'll reveal why you shouldn't use PivotTables and what to use instead...

By submitting this information, you agree to Deskbright's privacy policy and terms of service.

Comments