Cellwise

Text function

Excel LEN function

LEN counts how many characters are in a cell, including spaces and punctuation. Use it to check that IDs are the right length, find hidden spaces, or work out how much text to pull with LEFT or RIGHT.

fx=LEN(text)

Arguments

text
The text or cell to count. Numbers are counted as they would be written out.

LEN examples

Every result below was calculated live from this sample sheet.

ABC
1UsernameZipTweet draft
2jsmith02139Big launch today! Check out our new spring line.
3maria.gonzalez9021Thanks for 10k followers
4tk60614Store closed Monday.
  1. fx=LEN(A2)

    Result: 6

    Counts the letters in "jsmith": 6.

  2. fx=IF(LEN(B3)<>5,"Check zip","OK")

    Result: Check zip

    US zip codes have 5 digits, so the 4-character "9021" gets flagged.

  3. fx=LEN(C3)-LEN(TRIM(C3))

    Result: 1

    Counts the extra spaces TRIM would remove. Here there is 1 trailing space.

  4. fx=280-LEN(C2)

    Result: 232

    Shows how many characters are left before a 280-character limit.

How to use LEN

  1. Click the cell for the count.
  2. Type =LEN( and select the cell to measure.
  3. Close the bracket.
  4. Use the result in IF, LEFT, RIGHT or MID as needed.

Common LEN mistakes

Forgetting that spaces count

LEN includes every space, including invisible ones at the end. Compare with LEN(TRIM(A2)) to spot them.

Measuring formatted numbers

LEN counts the stored value, not what you see. 5.00 shown with two decimals counts as 1 character.

LEN FAQ

How do I count characters in a cell in Excel?

Use =LEN(A2). It counts letters, digits, spaces and punctuation.

How do I count characters without spaces in Excel?

Remove the spaces first: =LEN(SUBSTITUTE(A2," ","")).

How do I count how many times a character appears in a cell?

Subtract the length without it: =LEN(A2)-LEN(SUBSTITUTE(A2,",","")) counts the commas.

Practice LEN in these lessons

Guides that use LEN

Related functions

Updated 2026-10-31