Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=LEN(A2)Computed by a real spreadsheet engine on the sample data below.
| Text |
| Hello World |
| FormulaCraft |
| Excel 365 |
| Go |
| Spreadsheet tips |
=LEN(A2)→11
Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.
Yes — every space is one character. To count without spaces, use =LEN(SUBSTITUTE(A2," ","")). To ignore only leading and trailing spaces, use =LEN(TRIM(A2)).
Use =SUMPRODUCT(LEN(A2:A6)) — it sums the character length of every cell in the range and returns one number.
Use =LEN(A2)-LEN(SUBSTITUTE(A2,"a","")). The trick: SUBSTITUTE removes every "a"; the difference in length is how many were there. For case-insensitive, wrap both LEN arguments in UPPER.
Use =LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2)," ",""))+1. It counts the spaces between words and adds one. TRIM handles double-spaces or stray padding.
Most emoji are stored as surrogate pairs in UTF-16, so LEN sees two code units. There's no built-in fix in Excel; in Google Sheets, REGEXEXTRACTALL with a Unicode-aware pattern is the workaround.
LEN counts characters; LENB counts bytes. For ASCII text they match. For double-byte characters (Japanese, Chinese, Korean) LENB returns twice the character count. Use LEN unless you're dealing with multi-byte text on a system with DBCS support.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: