Build Your Own Function with LAMBDA

Excel Formulas › Dynamic Arrays

Excel 365Named function

LAMBDA lets you package a formula into a reusable custom function with your own name — =TaxInc(price) instead of copying a long calculation everywhere. Define it once in the Name Manager; call it like any built-in.


Quick formula: define a function (in Name Manager) named TaxInc as:
=LAMBDA(price, price * 1.08)
Then use it anywhere: =TaxInc(A2) returns the tax-included price. The logic lives in one place.

Functions used (tap for the full reference guide):

How it works

Once TaxInc is named, it behaves like a built-in function.

AB
1Price=TaxInc(A)
2100108
35054
4200216

The formula

The definition (saved as a named function TaxInc):

=LAMBDA(price, price * 1.08) // call it: =TaxInc(A2) → 108

How it works

LAMBDA turns a formula into a named, reusable function:

  1. A LAMBDA lists its parameters first, then the calculation that uses them: LAMBDA(price, price * 1.08).
  2. Open Formulas → Name Manager → New, name it TaxInc, and paste the LAMBDA as the “Refers to.”
  3. Now =TaxInc(A2) works like any function — and you can change the rule once in Name Manager to update every use.
  4. LAMBDAs can call themselves (recursion) and are what power MAP, REDUCE, SCAN, BYROW, and friends.

Test before naming. You can call a LAMBDA inline by adding the argument in extra parentheses: =LAMBDA(price, price*1.08)(100) returns 108. Once it works, save it in Name Manager to reuse it.

Try it: interactive demo

Live demo

Call the custom TaxInc function on a price.

TaxInc(price) =

Variations

Multiple parameters

A margin function:

=LAMBDA(cost, price, (price-cost)/price)

Inline test (no name needed)

Add the arguments to run it once:

=LAMBDA(x, x^2)(5)

Recursive LAMBDA

A named LAMBDA can call itself for loops/recursion (e.g. factorial).

Pitfalls & errors

LAMBDA alone in a cell shows #CALC!. A bare LAMBDA is a function definition, not a value. Call it (inline parentheses) or save it in Name Manager and call by name.

Excel 365 only. LAMBDA and named functions don’t exist before 365.

Name rules apply. The function name can’t clash with a cell reference or contain spaces — use names like TaxInc or Tax_Inc.

Practice workbook

📊
Download the free Build Your Own Function with LAMBDA practice workbook
LAMBDA examples shown with inline-call results and Name Manager setup steps, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I create a custom function in Excel with LAMBDA?
Write =LAMBDA(params, calculation), then save it in Formulas > Name Manager with a name like TaxInc. Call it as =TaxInc(A2). The logic lives in one editable place. Requires Excel 365.
How do I test a LAMBDA without naming it?
Add the arguments in extra parentheses: =LAMBDA(x, x^2)(5) returns 25. This runs the LAMBDA inline so you can verify it before saving.
Why does my LAMBDA show #CALC!?
A bare LAMBDA in a cell is a definition, not a value. Either call it inline with parentheses or save it as a named function and call it by name.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Transform values with MAP · Aggregate with REDUCE · Build an array with MAKEARRAY

Function references: LAMBDA