
π This article includes 2 downloadable practice files β
In this article
LEN returns the number of characters, including spaces.
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 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
| Text | Formula | Result |
|---|---|---|
| ABCDE1234F | =LEN(A2) | 10 |
| 9876543210 | =LEN(A3) | 11 |
| 27ABCDE1234F1Z5 | =LEN(A4) | 15 |
Results calculated in Excel.
Mistakes people make
| Mistake | What to do instead |
|---|---|
| Not spotting trailing spaces | Compare LEN(A2) with LEN(TRIM(A2)) |
| Counting words | Use LEN-LEN(SUBSTITUTE) trick for spaces + 1 |
Related functions
TRIM Β· SUBSTITUTE Β· LEFT
π Part of the free Excel course: Beginner β Expert Β· Try it in the Formula Lab or ask the AI Helper.
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.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time β plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul βBuild this skill next
This page is a quick function reference. Use it for syntax, then practise the function in a broader workflow.
Stuck on a step? Ask a question and the AI answers using this article.