Len() function



The Excel LEN function returns the length of a given text string as the number of characters. LEN will also count characters in numbers, but number formatting is not included.

The syntax of the function is:

LEN( text )
Where the text argument is the text string that you want to find the length of. This can be supplied to the Len function in any of the following ways:
·         directly;
·         as a text string returned from another formula;
·         as a reference to a cell containing a text string.

Excel Len Function Examples

In the spreadsheet below, the Len function is used to return the length of three different text strings (one of which is empty).
 Formulas:

A
B
1
test string
=LEN( A1 )
2
test string 2
=LEN( A2 )
3

=LEN( A3 )
 Results:

A
B
C
1
test string
11

2
test string 2
13

3

0
 - empty string has length 0

These functions may not be available in all languages. The languages that support DBCS include Japanese, Chinese (Simplified), Chinese (Traditional), and Korean.

Reference :


No comments:

Post a Comment

OR Function