FP

FormulaPilot

Spreadsheet formula tools

Open generator
Function reference

LEN in Excel & Google Sheets

LEN is used in 1 formula pattern in this library. Browse worked examples below, or use the generator to build a custom variation for your specific data.

When to use LEN

  • Validate that product codes are exactly 8 characters, flag descriptions that exceed a length limit, or calculate how many characters to extract in a MID formula.

Worked examples (1)

Common errors with LEN

LEN counts spaces

If your cells have leading or trailing spaces, LEN will include them. Wrap with TRIM first — LEN(TRIM(A2)) — to count only meaningful characters.

Returns a number, not the text

LEN always returns a numeric count. If you need the text back for display, this is expected — use LEN only for logic and calculations.

Frequently asked questions

How do I count only letters, not spaces?

Use LEN(SUBSTITUTE(A2," ","")) to strip spaces before counting. For a true letter-only count, you would need a more complex approach with SUMPRODUCT.

Need a custom variation?

Describe your specific LEN problem and get a formula written for your exact data.

Open generator with LEN