EXCEL SOLUTIONS

LEN function in Excel

Counts the characters in some text, including spaces.

BeginnerText

Syntax

=LEN(text)
Arguments of LEN
ArgumentWhat it means
textThe text or cell.

Examples with results

Every result below is calculated by the practice engine on the sample data shown, not typed in by hand.

Examples that need no data

  • =LEN("BusyDayKit")10

    Ten characters

Contact list pasted from an email (fictional)

RowAB
1Raw nameEmail
2 amira HASSAN [email protected]
3ben CARTER[email protected]
4CHEN wei[email protected]
5dina ali[email protected]
Contact list pasted from an email (fictional) Row 1 holds the headings. All data is fictional. Dates are year-month-day.

Download CSV

  • =LEN(A2)17

    A messy name has extra spaces: the length shows it

  • =LEN(TRIM(A2))12

    The length after TRIM

Try it yourself

Change the formula or switch to other sample data.

Press Calculate to see the result.

The practice box runs in your browser with BDK’s own calculator, which covers about 60 common functions. Cell references work as in Excel (B2, B2:B9). Your formulas are not saved or sent anywhere. For anything unusual, check the result in Excel itself.

How people use LEN at work

  • Administration

    Check that codes have the right length.

    =IF(LEN(A2)=5,"OK","Check")OK
    Data: Stock levels (fictional)
  • General office

    Spot hidden spaces: compare LEN with LEN(TRIM()).

    =LEN(B3)-LEN(TRIM(B3))1
    Data: Contact list pasted from an email (fictional)

Common mistakes and tips

  • Dates are numbers, so LEN of a date is the length of its serial number.

Works in

All versions of Excel, and Google Sheets.

Related formulas

TRIMLEFT

Lessons that use it

Need Something Different? Let’s Talk.

Looking for different features or something built around your workflow? Share your idea with us.