A phone number with 9 digits is an error you cannot see at a glance. LEN counts the characters of a cell. Combined with a test, it checks a whole column and shows the lines that are too short or too long.
The following exercise shows you how to validate data with LEN.
What you will practice in this exercise
You work on a list of customers with codes and phone numbers. You answer 6 questions, one formula per question:
- Is the code exactly 6 characters? (LEN = 6)
- Does the phone number have 10 digits?
- Check a phone number with 9 digits
- Double check: code and phone (AND)
- The same double check on another row
- Number of missing digits (0 if correct)
Practice with exercises
LEN — Validate length
Check that a code or phone number has the right number of characters with LEN.
Related articles
All the exercises in this series are based on real cases found on Excel forums. Each one answers a question that Excel users really ask.