Spreadsheet formulas explained, side by side

LEN Function in Excel, Google Sheets, Airtable & Notion

LEN returns the number of characters in a text string, including spaces and punctuation. LEN("Hello, world") is 12.

Syntax in each app

AppSupportSyntax & notes
Excel✔ Built inLEN(text)
Google Sheets✔ Built inLEN(text)
Airtable✔ Built inLEN(string)
Notion✔ Built inlength(text)
Also works on lists, where it counts items. Method form: prop("Name").length().
Try LEN with your own values
Result (as Excel & Google Sheets return it)
12
Your formula, ready to paste
Excel=LEN("Hello, world") open excel.new ↗
Google Sheets=LEN("Hello, world") open sheets.new ↗
AirtableLEN("Hello, world")
Notionlength("Hello, world")

Arguments

ArgumentWhat it means
textThe text to measure. Numbers are measured as their stored digits, not their formatted display.

Examples

FormulaResultWhyCopy
=LEN("Hello, world")12Spaces and punctuation count.
=LEN(A2)-LEN(TRIM(A2))Extra spacesHow many surplus spaces TRIM would remove.
=LEN(A2)-LEN(SUBSTITUTE(A2, ",", ""))Number of commasCount how often a character appears.
=LEN(A2)>280TRUE if too longCheck a length limit.

Examples use Excel / Google Sheets syntax unless noted.

How LEN works

LEN is mostly a building block. Use it to check input lengths (postcodes, IDs, tweet-sized text), with RIGHT and MID to work out how much text is left, and in the classic counting trick: the length before minus the length after removing a character with SUBSTITUTE tells you how many times it appears. Add 1 to the comma count to get the number of items in a comma-separated list.

Invisible characters are counted too. If LEN says 6 for a cell that shows “Apple”, there is a trailing space or a non-breaking space from copied web text. =LEN(TRIM(A2)) shows the cleaned length. A number is measured as stored, so a cell showing $1,000.00 that holds 1000 has a length of 4.

Airtable's LEN and Notion's length() work the same way on text. Notion's length() also counts the items in a list, e.g. how many tags or related pages a row has. All four apps count an emoji as 2 characters.

Frequently Asked Questions

How do I count words in a cell?
Count spaces and add one: =IF(TRIM(A2)="", 0, LEN(TRIM(A2)) - LEN(SUBSTITUTE(TRIM(A2), " ", "")) + 1).

Part of the Text functions. Results in the tester follow Excel and Google Sheets behaviour; always double-check important work in your own file.