LEN function
the number of characters in a text string.
Text
Where can you use it?
Data preparation and reporting teams. Use this group to clean, split or reformat IDs, names and descriptions before using them in reports.
Scenario in the workbook
Check imported code lengths. A space or hyphen also counts as a character.
A worked example from the workbook
| Row | A |
|---|---|
| 6 | Invoice code |
| 7 | INV-042 |
| 8 | inv-125 |
| 9 | AB-0007 |
Trial 1
=LEN(A7)Expected result7
See the inputs and instructions for all 3 examplesSyntax
LEN(text)
Copyable formulas
English Excel · en-US
=LEN("INV-042")Turkish Excel · tr-TR
=UZUNLUK("INV-042")Expected result
7
Worked examples
Check imported code lengths. A space or hyphen also counts as a character.
Open the English sheet. Inputs begin at A6. F7:F9 show the live results and G7:G9 show the original results for comparison.
| Row | A |
|---|---|
| 6 | Invoice code |
| 7 | INV-042 |
| 8 | inv-125 |
| 9 | AB-0007 |
| Case | Formula | Expected result |
|---|---|---|
| Trial 1 | =LEN(A7) |
7 |
| Trial 2 | =LEN(A9) |
7 |
| Trial 3 | =LEN(A7&" ") |
8 |