Syntax, a live playground, a measured length gallery, the spaces-count trap, and a sourced error library: measuring text length.
Returns the number of characters in text. Spaces count; an empty string is 0.
LEN returns the number of characters in a text string — every character, including spaces and punctuation. Every row was measured live in HyperFormula. Click any row to load it.
| Expression | Result | Why |
|---|---|---|
| =LEN(A2) | 5 | Excel has 5 characters |
| =LEN(A3) | 7 | Formula has 7 |
| =LEN(A4) | 6 | Lookup has 6 |
| =LEN(A5) | 3 | Lab has 3 |
| =LEN("a b") | 3 | The space counts |
| =LEN("") | 0 | Empty string is 0 |
| =LEN(A2&"!") | 6 | Concatenation adds 1 |
| =LEN(12345) | 5 | Numbers count their digits |
| Expression | Result | Why |
|---|---|---|
| =LEN(TRIM(" hi ")) | 2 | TRIM first to ignore padding spaces |
| =LEN(A2)-LEN(SUBSTITUTE(A2,"e","")) | 1 | Count occurrences of a character |
Edit the table or type any formula — the engine evaluates instantly. Load a preset to see LEN count spaces, return 0 for an empty string, and measure a concatenated string.
8 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.
LEN is available across modern Excel, Google Sheets and LibreOffice. It has been in Excel since 2003.
| Platform | Support | Notes | Gotcha |
|---|
LEN is one piece. The full course walks the toolkit end to end with live, measured examples.