Cellgrids Cellgridsby LearnWithRinkesh
Home › Excel tutorials › How to Count Characters in Excel (LEN)

How to Count Characters in Excel (LEN Function)

By Rinkesh Shah · Business Analyst, 8 years in data · Updated 2026-10-31

▶ Video coming soon

LEN counts the characters in a cell, including spaces.

Basic use

=LEN(A2)

For "Excel tips" it returns 10, because the space counts.

Count a specific character

To count how many times a letter or symbol appears in a cell:

=LEN(A2)-LEN(SUBSTITUTE(A2, "a", ""))

This removes every "a" and compares the lengths. For case-insensitive counting, wrap A2 in LOWER.

Count words in a cell

=LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2), " ", ""))+1

Count characters in a whole range

=SUMPRODUCT(LEN(A2:A20))

Check text length rules

Tip

If LEN gives a larger number than you expect, there are hidden spaces. Clean the cell with TRIM.

Worked example

=LEN(A2) for "Excel 101" returns 9, because spaces count. To count how many times "a" appears: =LEN(A2)-LEN(SUBSTITUTE(A2,"a","")).

Common mistakes

Frequently asked questions

Does LEN count spaces?

Yes, all of them.

How do I count words?

=LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ",""))+1.

Can I limit text to a length?

Yes, use Data Validation with a text length rule.

Practice this online, free

Reading is only half of learning Excel. Cellgrids is a free place for online Excel practice: solve Excel formula exercises in a live spreadsheet, prepare for Excel interview questions, and work through business case studies built for data analytics and business analytics roles.

Practice these formulas: LEN, SUBSTITUTE, SUMPRODUCT.

Start Excel practice → Case studies