Going Stellar

Home/Google Sheets reference

Google Sheets function · Text

LEN in Google Sheets: syntax and examples

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

ArgumentTypeRequiredWhat it does
texttextyesThe 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 .

=LEN(A3)

Result: 10

Spaces count: two leading and two trailing spaces add four.

Run in a Google Sheet (English US locale) on .

=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 .

=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 .

=ARRAYFORMULA(LEN(A2:A4))

Result:

5
10
7

Length of every cell in a column.

Run in a Google Sheet (English US locale) on .

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.

Sources

  1. LEN (Docs Editors Help)

Markdown version · All functions