fx =LEN(A1)ABCJohnSmithJohn SmithJaneDoeJane DoeAlexWongAlex Wong
📝 Text

LEN Formula for Text Manipulation

Count the number of characters in text. Copy-paste ready for Excel, Google Sheets, and Airtable.

=LEN(A1)
When you need this: When you need to validate that product codes (A1) are exactly 8 characters long, reject if too short or long.

How it works

  1. 1LEN counts every character in the text, including spaces and punctuation.
  2. 2Returns a number (e.g., "ABC123" = 6 characters).
  3. 3Use with IF to validate: =IF(LEN(A1)=8,"Valid","Invalid")

Variations

Check if text is not empty
=IF(LEN(A1)>0,"Has text","Empty")
Remove spaces then count
=LEN(SUBSTITUTE(A1," ",""))

Related Formulas

Need a formula that's not here?

Generate custom formula →