📝 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
- 1LEN counts every character in the text, including spaces and punctuation.
- 2Returns a number (e.g., "ABC123" = 6 characters).
- 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
CONCATENATE / TEXTJOIN — Join text from multiple cellsTextLEFT / RIGHT / MID — Extract part of a text stringTextTRIM — Remove extra spaces from textTextTEXT — Format a number as text with a specific formatText
Need a formula that's not here?
Generate custom formula →