LEN function

Description

Length of string function. LEN(str) returns the length of the string str.

Example

LEN(A20) returns 5 if cell A20 contains the string "Jones".

Calculator

LEN()

Unicode and UTF-16 encoding

MedCalc stores strings using UTF-16 character encoding. The LEN function returns the length of the string as the number of UTF-16 code units (16-bit units). Use the LEN function when you need the length of a string in other string functions such as the LEFT(str,n), MID(str,pos,n), or RIGHT(str,n) functions.

If str contains characters in the Unicode range U+10000 to U+10FFFF, then the actual number of characters is returned by the ULEN function. For example, for the Unicode character U+2070E (𠜎), LEN("𠜎") returns 2 and ULEN("𠜎") returns 1.

Related functions

External links

This site uses cookies to store information on your computer. More info...