To illustrate the power of LAMBDA, here’s a function written using the notation to compute the length of the hypotenuse of a right-angled triangle:
=LAMBDA( X, Y, SQRT( X*X+Y*Y ) )
LAMBDA complements the March 2020 release of LET, which allows us to structure the same example like this:
=LAMBDA( X, Y, LET( XS, X*X, YS, Y*Y, SQRT( XS+YS ) ) )
The function takes two arguments named X and Y, binds the value of XX to the name XS, binds the value of YY to YS, and returns SQRT( XS+YS) as its result.
The existing Name Manager in Excel allows any formula to be given a name. If we name our function PYTHAGORAS, then a formula such as PYTHAGORAS(3,4) evaluates to 5. Once named, you call the function by name, eliminating the need to repeat entire formulas when you want to use them.
Last modified 06 April 2022