Description
The LEN function returns the number of characters in a text value.
Usage
LEN(text)
| Argument | Type | Required | Description |
|---|---|---|---|
| text | Text | Yes | The input text |
Remarks
If the text argument is blank, then the result is 0.
LEN is consistent with LEFT, MID, and RIGHT: all four functions count characters the same way, so a formula like LEFT(TEXT, LEN(TEXT) - 3) returns TEXT with its last three characters removed.
Multi-byte characters and emoji
LEN counts characters the way Excel and most other spreadsheet and database systems do. For most text — letters, digits, punctuation, and characters from common writing systems — this matches what you see on screen.
A few characters are stored using more than one code unit and will count as more than one in LEN. This includes most emoji (for example, LEN("😀") is 2), flags and other emoji built from a sequence (for example, LEN("🏳️🌈") is 6), and a small number of supplementary characters from less common scripts.
If you need to count user-perceived characters — where each emoji or composite character counts as one regardless of how it is stored — use LENG instead.
Example
LEN is often combined with LEFT, MID, or RIGHT to slice a text relative to its length. For instance, to drop the last three characters of a CODE text field:
LEFT(CODE, LEN(CODE) - 3)
You can also use LEN in a validation rule to require a minimum or exact length. To require that a REFERENCE field contains exactly 8 characters:
LEN(REFERENCE) == 8