# LEN in Google Sheets: syntax and examples

URL: https://goingstellar.ro/reference/sheets/len/

LEN counts every character in a text, including spaces. It is the basis for checks like "is this code 8 characters long" and for word counts.

## Syntax

```
LEN(text)
```

## Arguments

- `text` (text, required: yes): The text to measure. Numbers and dates are converted to text first.

## Examples

The examples use this table, starting in A1:

| Text |
|---|
| Hello |
|   padded   |
| Ana Pop |

```
=LEN(A2)
```

Result: `5`

Characters in a word. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=LEN(A3)
```

Result: `10`

Spaces count: two leading and two trailing spaces add four. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=LEN(TRIM(A3))
```

Result: `6`

TRIM removes the extra spaces first, so only the word is counted. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=LEN(A4) - LEN(SUBSTITUTE(A4, " ", "")) + 1
```

Result: `2`

Counts words by comparing length with and without spaces. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=ARRAYFORMULA(LEN(A2:A4))
```

Result: 

| 5 |
|---|
| 10 |
| 7 |

Length of every cell in a column. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- Spaces are characters. A cell that looks like a five-letter word can return 10 if it has leading or trailing spaces. TRIM first.
- A date is counted as its displayed text, not as a number: LEN(DATE(2026,11,29)) returns 10, the length of 11/29/2026.
- A boolean is counted as its text: LEN(TRUE) is 4.
- A formula that returns an empty text and a truly blank cell both give 0, so LEN cannot tell them apart.

## Compared with Excel

Same syntax in Excel.

## Related functions

- [TRIM](https://goingstellar.ro/reference/sheets/trim/)
- [LEFT](https://goingstellar.ro/reference/sheets/left/)
- [RIGHT](https://goingstellar.ro/reference/sheets/right/)
- [MID](https://goingstellar.ro/reference/sheets/mid/)
- [SUBSTITUTE](https://goingstellar.ro/reference/sheets/substitute/)
- [FIND](https://goingstellar.ro/reference/sheets/find/)

## Sources

- [LEN (Docs Editors Help)](https://support.google.com/docs/answer/3094081)

