Description
Checks that the Legal Entity Identifier (LEI) input in the function is valid. Returns 1 if the LEI is valid, 0 otherwise.
Syntax
=MM_CHECKLEI("LEICodeValue")-
"LEICodeValue"
String. LEI to check.
Returns 1 if the LEI is valid, 0 otherwise.
Remarks
- The algorithm used to check if the LEI code is valid is the following:
- Checks that LEICodeValue is 20 characters long and ends with two numerical characters between '02' and '98'. If not, the LEI is invalid.
- Replaces each letter by its corresponding number (A = 10, B = 11,..., Z = 35) and divide the result by 97. If the remainder of the division is equal to 1, then the LEI is valid. Otherwise, it is not.
A similar function exists to check if an ISIN is valid: MM_CHECKISIN.
Example

Formula 1: =MM_CHECKLEI(A3)
Returns 1 since the LEI code is valid.Formula 2: =MM_CHECKLEI(A4)
Returns 0 because the string in A4 doesn't meet all criteria.