How to Create Custom Functions with LAMBDA in Excel

Write your own reusable function with LAMBDA — define the inputs once, then call it on any cell.

You will learn to

  • Write a one-parameter LAMBDA and call it
  • Name a LAMBDA with LET and reuse it
  • Write a LAMBDA with two parameters

How it works

LAMBDA lets you write a custom function from ordinary Excel formulas. =LAMBDA(sales,IF(sales>=50000,sales*0.06,sales*0.04)) defines a commission rule with one input called sales. Call it by putting the arguments in brackets right after it: =LAMBDA(sales,…)(B2).

To reuse a LAMBDA, give it a name. Inside one formula, LET does this: =LET(comm,LAMBDA(s,…),comm(B3)+comm(C3)). Across a whole workbook, paste the LAMBDA into Formulas > Name Manager under a name like COMMISSION, then use =COMMISSION(B2) anywhere.

=LAMBDA(sales,IF(sales>=50000,sales*0.06,sales*0.04))(B2)