LEN

Beginner

Text

Returns the number of characters in a text string, including spaces and special characters.

Syntax
=LEN(text)
Parameters
text
Required
(text)

Text string to count characters in

Examples
Real-world examples to help you understand how to use LEN

Count characters

=LEN("Hello World")

Returns 11 (including the space)

Result: 11

Check text length

=LEN(A1)

Counts characters in cell A1

Result: Character count

Validate input length

=IF(LEN(A1)>10, "Too long", "OK")

Checks if text exceeds 10 characters

Result: Too long or OK

Common Use Cases
  • Validate input length
  • Check password strength
  • Count characters for limits
  • Data quality checks
  • Format validation
Pro Tips
  • 💡LEN counts all characters including spaces
  • 💡Use TRIM to remove extra spaces first
  • 💡LENB counts bytes (useful for double-byte characters)
  • 💡Returns 0 for empty cells
Common Errors
  • ⚠️Not accounting for leading/trailing spaces
  • ⚠️Confusion between LEN and LENB
  • ⚠️Expecting LEN to ignore spaces
Related Formulas

Need a Custom LEN Formula?

Our AI can generate tailored formulas based on your specific needs

Generate Custom Formula