Check code length with LEN
Use LEN to validate that product codes are the right length.
LEN
Counts the characters in a text value, spaces included. Below is 1 interactive exercise that puts it to work on realistic business data — you write the formula, and get told exactly what went wrong when it does not work.
1 free LEN exercise · about 3 minutes · no sign-up · runs in your browser
First up: Check code length with LEN (3 min). The sheet holds the data for every LEN exercise on this page, with the answer cells blank; the feedback and the solution are in the browser exercise.
LEN(text)
Need a refresher? Learn LEN — syntax, a worked example and where it goes wrong.
Last updated
Ordered from most approachable to hardest.
Counts the characters in a text value, spaces included. It belongs to the text functions family, and it shows up constantly in real work — which is why it is worth being genuinely fluent rather than merely familiar.
Reading about a function is not the same as being able to write it. The exercises on this page exist because the gap between recognising LEN and producing it from memory, correctly, on data you have not seen before, only closes by doing it.