This page isn't translated yet, so its text is in English. Function names and formulas are shown in your Excel language.
Excel function · Finding text
NBCAR(LEN)
Counts the characters in a text.
What it does
LEN returns how many characters a text has. Spaces, punctuation and digits all count. It is useful for checking codes that must have a fixed length, and as a building block with LEFT, RIGHT and MID.
Syntax
=NBCAR(text)Arguments in square brackets are optional, and … means you can add more of the same. In this Excel language, arguments are separated by ;
Arguments
- text
- The text to measure, usually a cell.
Example
Stock codes should be 9 characters long. Is this one?
| A | B | |
|---|---|---|
| 1 | Code | Length |
| 2 | SKU-40518 | 9 |
The formula in B2:
=NBCAR(A2)Result: 9
SKU-40518 has three letters, a hyphen and five digits: 3 + 1 + 5 = 9.
Common mistakes
- Forgetting that spaces count, including ones you can't see at the end of a cell. Clean them with
TRIMfirst. - Expecting a number's formatting to count.
LENmeasures the stored value, so 0.5 shown as 50% still has 3 characters.
In other Excel languages
Excel translates function names, and in some languages the argument separator too. Type the name your Excel shows.
| Excel language | Function name | Separator |
|---|---|---|
| English | LEN | , |
| Deutsch | LÄNGE | ; |
| Français | NBCAR | ; |
| Español (España) | LARGO | ; |
| Español (México) | LARGO | , |
| 日本語 | LEN | , |
| 한국어 | LEN | , |
| 繁體中文 | LEN | , |
| ไทย | LEN | , |
| ខ្មែរ | LEN | , |
| Tiếng Việt | LEN | ; |