LEN
TextbeginnerLEN counts every character in a cell, including spaces. It's primarily a helper formula — you'll rarely use it alone, but it's essential inside other text formulas (like MID, RIGHT, SUBSTITUTE) when you need to calculate string lengths dynamically.
Syntax
=LEN(text)Parameters
textThe text string or cell reference.? = optional parameter
Worked Example
How long is the vendor name 'BrightPath Analytics'?
| Row numbers | B |
|---|---|
| Header row | vendor_name |
| 2 | BrightPath Analytics |
| 3 | Cloudline Software |
| 4 | Summit Consulting Group |
| 5 | Apex Office Supply |
| 6 | Meridian Travel Co. |
Formula
=LEN(A2)Result
20LEN counts every character in A2, including the space between 'BrightPath' and 'Analytics'. In this sample, A2 contains 20 characters.
Practice Exercises
2 exercises - work through each one using the data table below
Question
You're building a validation check to flag unusually long vendor names. What is the length (number of characters) of the vendor name 'Summit Ridge Consulting'?
Dataset
Showing rows 1-20
Download CSV| Row numbers | A | B |
|---|---|---|
| Header row | ||
| 2 | INV-1001 | Cloudline Software |
| 3 | INV-1002 | Apex Office Supply |
| 4 | INV-1003 | Summit Consulting Group |
| 5 | INV-1004 | Meridian Travel Co. |
| 6 | INV-1005 | Forge & Frame Creative |
| 7 | INV-1006 | NovaTech Solutions |
| 8 | INV-1007 | Atlas Hardware Co. |
| 9 | INV-1008 | Clearview Data Systems |
| 10 | INV-1009 | Redstone Marketing |
| 11 | INV-1010 | Keystone Legal Advisors |
| 12 | INV-1011 | Cloudline Software |
| 13 | INV-1012 | Basecamp Events |
| 14 | INV-1013 | Apex Office Supply |
| 15 | INV-1014 | BrightPath Analytics |
| 16 | INV-1015 | Meridian Travel Co. |
| 17 | INV-1016 | Clearview Data Systems |
| 18 | INV-1017 | Apex Office Supply |
| 19 | INV-1018 | Summit Consulting Group |
| 20 | INV-1019 | Cloudline Software |
| 21 | INV-1020 | Atlas Hardware Co. |
| 22 |
Scroll to explore the table, then sort or filter by column as needed.
Hints
Your Answer
Question
You want to check whether a vendor name has any leading or trailing whitespace. The formula =LEN(B2) - LEN(TRIM(B2)) tells you how many extra space characters exist. For the clean vendor name 'Cloudline Software' (no extra spaces), what does this formula return?
Dataset
Showing rows 1-10
Download CSV| Row numbers | A | B |
|---|---|---|
| Header row | ||
| 2 | INV-1001 | Cloudline Software |
| 3 | INV-1002 | Apex Office Supply |
| 4 | INV-1003 | Summit Consulting Group |
| 5 | INV-1004 | Meridian Travel Co. |
| 6 | INV-1005 | Forge & Frame Creative |
| 7 | INV-1006 | NovaTech Solutions |
| 8 | INV-1007 | Atlas Hardware Co. |
| 9 | INV-1008 | Clearview Data Systems |
| 10 | INV-1009 | Redstone Marketing |
| 11 | INV-1010 | Keystone Legal Advisors |
| 12 |
Scroll to explore the table, then sort or filter by column as needed.
Hints
Your Answer
Want more practice?
Test Me mode randomizes exercises across all formulas without telling you which formula to use.