LEN

Textbeginner

LEN 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

Excel:=LEN(text)
Google Sheets: Same syntax

Parameters

textThe text string or cell reference.

? = optional parameter

Worked Example

How long is the vendor name 'BrightPath Analytics'?

Row numbersB
Header rowvendor_name
2BrightPath Analytics
3Cloudline Software
4Summit Consulting Group
5Apex Office Supply
6Meridian Travel Co.

Formula

=LEN(A2)

Result

20

LEN 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

Exercise 1 of 2beginner
#LEN-001

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 numbersAB
Header row
2INV-1001Cloudline Software
3INV-1002Apex Office Supply
4INV-1003Summit Consulting Group
5INV-1004Meridian Travel Co.
6INV-1005Forge & Frame Creative
7INV-1006NovaTech Solutions
8INV-1007Atlas Hardware Co.
9INV-1008Clearview Data Systems
10INV-1009Redstone Marketing
11INV-1010Keystone Legal Advisors
12INV-1011Cloudline Software
13INV-1012Basecamp Events
14INV-1013Apex Office Supply
15INV-1014BrightPath Analytics
16INV-1015Meridian Travel Co.
17INV-1016Clearview Data Systems
18INV-1017Apex Office Supply
19INV-1018Summit Consulting Group
20INV-1019Cloudline Software
21INV-1020Atlas Hardware Co.
22

Scroll to explore the table, then sort or filter by column as needed.

Hints

Your Answer

Exercise 2 of 2intermediate
#LEN-002

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 numbersAB
Header row
2INV-1001Cloudline Software
3INV-1002Apex Office Supply
4INV-1003Summit Consulting Group
5INV-1004Meridian Travel Co.
6INV-1005Forge & Frame Creative
7INV-1006NovaTech Solutions
8INV-1007Atlas Hardware Co.
9INV-1008Clearview Data Systems
10INV-1009Redstone Marketing
11INV-1010Keystone 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.

Try Test Me ->