LEN
Return how many characters a piece of text contains.
Syntax
LEN(text) | Argument | Required | Description |
|---|---|---|
text | Required | The text to measure. |
Examples
Every example below was executed against VisiGrid engine 0.35.0 — not
transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.
| Formula | Result | Notes |
|---|---|---|
=LEN("Spreadsheet") | 11 | |
=LEN(" Bo ") | 4 | Spaces count, which is the whole reason this function is a diagnostic. |
=LEN(TRIM(" Bo ")) | 2 |
Mostly used to find what you cannot see
LEN is rarely the answer to a question anyone asked. It is how you find out
why two values that look identical refuse to match:
=LEN(A1) → 4
=LEN(B1) → 2
Both cells show Bo. One of them has padding. That is the single most common
cause of a lookup returning #N/A on data that is obviously there — see
why a VLOOKUP fails, and
TRIM for the fix.
Characters, not bytes
An accented letter or an emoji counts as one. That matters when validating
fixed-width fields against a system that counts bytes instead — the two will
disagree on any non-ASCII input, and LEN is not the one that is wrong.
Excel compatibility
Matches Excel, counting characters rather than bytes.