Measuring Text with LEN
Part of the Fundamentals section of Coddy's Excel journey — lesson 31 of 42.
How long is a piece of text? LEN (short for length) counts its characters:
=LEN(A2)With spreadsheet in A2, the answer is 11. LEN takes text in and hands a number out, which means you can do math with the result, just like with SUM.
Here's the classic gotcha: spaces count. hi there is not 7 characters, it's 8, because the space between the words is a character like any other. So is punctuation. Every key press that produced a visible-or-invisible symbol gets counted.
Where does this matter? Anywhere text has size limits: usernames, tweet-length checks, product codes that must be exactly 12 characters. An empty cell measures 0, nothing there to count.
Challenge
BeginnerTwo entries are waiting to be measured: a word in A2 and a phrase (with a space!) in A3.
- In
B2: the length ofA2 - In
B3: the length ofA3
Use LEN with cell references, the texts are different in every test.
Try it yourself
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Text | Length | |||||
| 2 | spreadsheet | ||||||
| 3 | hi there | ||||||
| 4 | |||||||
| 5 | |||||||
| 6 | |||||||
| 7 | |||||||
| 8 | |||||||
| 9 | |||||||
| 10 | |||||||
| 11 | |||||||
| 12 | |||||||
| 13 | |||||||
| 14 |
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1Meet the Spreadsheet
What Is a Spreadsheet?Cells and ReferencesYour First CellsRows, Columns and the GridRecap: Meet the Grid2Entering Data
Text and NumbersBuilding a Small TableEditing and Clearing CellsNumbers That Mean SomethingRecap: Entering Data3Your First Formula
What Is a Formula?Writing a FormulaFormulas with CellsArithmetic OperatorsOrder of OperationsRecap: First Formulas6Working with Text
Joining TextUPPER and LOWERMeasuring Text with LENLEFT, RIGHT and MIDRecap: Working with Text