LEN Function in Excel: Count Characters in Text

LEN Function in Excel: Count Characters in Text featured illustration

πŸ“Ž This article includes 2 downloadable practice files ↓

⏱ 2 min readUpdated 5 October 2026

TextLevel: BeginnerAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. LEN in practice
  6. Where you will use it
  7. Worked example
  8. Mistakes people make
  9. Related functions
  10. Continue learning

LEN returns the number of characters, including spaces.

Advertisement

Syntax

=LEN(text)
Argument What it means
text Text or a cell.

Examples

Example 1

=LEN(A2)=10

TRUE if a mobile number has exactly 10 digits.

Example 2

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

Number of items in a comma-separated list.

πŸ’‘ LEN is the quickest way to spot hidden trailing spaces: two cells that look identical but have different LEN values.

LEN in practice

Where you will use it

  • Validate PAN (10), mobile (10), GSTIN (15) lengths
  • Find hidden spaces (LEN vs LEN(TRIM))
  • Count characters for SMS limits

Worked example

TextFormulaResult
ABCDE1234F=LEN(A2)10
9876543210 =LEN(A3)11
27ABCDE1234F1Z5=LEN(A4)15

Results calculated in Excel.

Mistakes people make

MistakeWhat to do instead
Not spotting trailing spacesCompare LEN(A2) with LEN(TRIM(A2))
Counting wordsUse LEN-LEN(SUBSTITUTE) trick for spaces + 1

TRIM Β· SUBSTITUTE Β· LEFT

πŸ“š Part of the free Excel course: Beginner β†’ Expert Β· Try it in the Formula Lab or ask the AI Helper.

⚑ Interactive Practice Lab & Formula Tester:

Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.

πŸ“Ž Practice files for this article

⬇ Download all 2 files (ZIP Β· 38 KB)

  • πŸ“—
    Text-cleaning scenarios workbookExtract and clean text (GSTIN, PAN, emails, names) with PASS/FAIL checks, plus the 3 mistakes that break text formulas.
    ⬇ XLSX Β· 8 KB
  • πŸ“—
    Practice workbook: Text & cleaning24 tasks on realistic sales data β€” type your formula, the Check column turns green when it is right. Answers sheet included.
    ⬇ XLSX Β· 35 KB

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong