How to Use the LEN Function in Google Sheets: Count Characters Easily
How to Use the LEN Function in Google Sheets: Count Characters Easily
There are times when working with Google Sheets where you need to know how many characters are in a cell. Whether you’re checking if a phone number is correctly formatted or filtering names that are too short or too long, the LEN
function can help you solve these problems effortlessly.
This post walks you through the basics of the LEN function and provides practical examples that are easy to follow—even if you’re new to Google Sheets.
✅ Basic Syntax of the LEN Function
=LEN(text)
• text
: This is the string (or cell reference) whose length you want to calculate.
• Spaces and special characters are counted as characters. For example, "John Doe"
→ 8 characters (space included).
✦ Example 1: Count characters in a name
A (Name) | B (Character Count) |
---|---|
Michael | =LEN(A2) |
J | =LEN(A3) |
Sarah K | =LEN(A4) |
🧾 Result:
- A2: 7
- A3: 1
- A4: 7
Use case: Identify users with single-character names for validation.
✦ Example 2: Validate phone number length
A (Phone Number) | B (Length) |
---|---|
123-456-7890 | =LEN(A2) |
123-45-6789 | =LEN(A3) |
123 456 7890 | =LEN(A4) |
🧾 Result:
- A2: 12
- A3: 11
- A4: 12
Helps you check if all numbers follow a consistent format.
✦ Example 3: Identify names with less than 3 characters
A (Name) | B (Length) | C (Less than 3?) |
---|---|---|
John | =LEN(A2) | =IF(LEN(A2)<=2,”Yes”,”No”) |
Li | =LEN(A3) | =IF(LEN(A3)<=2,”Yes”,”No”) |
Kim | =LEN(A4) | =IF(LEN(A4)<=2,”Yes”,”No”) |
Quickly filter users based on name length for data validation.
✦ Example 4: Remove spaces and compare length
A (Text) | B (Original LEN) | C (No Spaces) | D (New LEN) |
---|---|---|---|
H e l l o W o r l d | =LEN(A2) | =SUBSTITUTE(A2,” “,””) | =LEN(C2) |
Great for cleaning data or checking “true” content length.
🧪 Practical QA Checklist
• Does LEN count spaces and special characters?
• Are numbers included in the character count?
• Do Korean, English, and numbers all count as one character each?
• Why combine LEN with SUBSTITUTE or TRIM?
• Can I use LEN to filter by length?
• Can I trigger formulas based on character count?
📌 Final Thoughts: Small Function, Big Power
The LEN
function is simple but incredibly useful. It plays a major role in data quality control, conditional filtering, and dynamic formula behavior. Used with functions like IF
, FILTER
, or ARRAYFORMULA
, it opens the door to more powerful automation workflows.
Try applying the =LEN()
function to clean up your spreadsheets, and stay tuned for the next tutorial where we’ll explore even more ways to automate your Google Sheets workflow.