Logical

LAMBDA Function in Excel

Creates custom, reusable functions that can be called by a friendly name.

Syntax

  • =LAMBDA([parameter1], [parameter2], ..., calculation)

Arguments

  • parameter1 (optional): First parameter name
  • calculation (required): Formula to execute

Examples

  • =LAMBDA(x, x*2)(5) - Double a number - Result: 10

Excel LAMBDA function documentation

  • LAMBDA creates custom reusable functions without VBA by defining parameters and a calculation.
  • Syntax: =LAMBDA([parameter1, …], calculation). Store in Name Manager to call by name.
  • Microsoft 365 feature — powers advanced dynamic array workflows with [MAP](/functions/map/), [BYROW](/functions/byrow/).
  • Related: [LET](/functions/let/), [MAP](/functions/map/), [IF](/functions/if/).

LAMBDA syntax and storing custom functions

  • Define name DiscountPrice → =LAMBDA(price, pct, price*(1-pct)).
  • Call in sheet: =DiscountPrice(B2, 0.1).
  • Parameters are local — no VBA module or add-in required.
  • Test inline first: =LAMBDA(x, x*2)(5) returns 10 before saving as name.

Step-by-step: reusable sales tax function

  • Step 1 — Formula: =LAMBDA(amount, rate, amount*(1+rate)).
  • Step 2 — Formulas → Name Manager → New → Name: GrossWithTax.
  • Step 3 — Refers to: =LAMBDA(amount, rate, amount*(1+rate)).
  • Step 4 — Use =GrossWithTax(D2, $F$1) across table.
  • Step 5 — Document parameters on Settings sheet for auditors.

LAMBDA vs VBA vs helper columns

  • LAMBDA — pure worksheet function; no macro security issues.
  • VBA UDF — full programming; better for complex IO and loops.
  • Helper column — simpler for one-off logic; LAMBDA when pattern repeats 50+ times.
  • Combine LAMBDA + MAP to transform arrays without filling formulas down.

Worked examples to copy

  • Inline test: =LAMBDA(x, x^2)(9) → 81.
  • Named: AddVAT = LAMBDA(net, net*1.2).
  • Two params: =LAMBDA(a,b, IF(a>b, a, b))(3,7) → 7.
  • With LET inside: LAMBDA(x, LET(y, x*2, y+1)) as named function.

People also ask

  • LAMBDA without Name Manager? — Call inline LAMBDA(...)(args) for tests only.
  • LAMBDA Excel version? — Microsoft 365; not in Excel 2019 desktop.
  • LAMBDA vs macro? — LAMBDA is formula-only; macros do file/system tasks.
  • LAMBDA recursion? — Limited; advanced scenarios use helper names carefully.

Common errors

  • Must be named in Name Manager for reuse

Use cases

  • Custom functions
  • Reusable logic
  • Advanced calculations

Frequently asked questions

  • How do I create a reusable custom function with LAMBDA? 1) Go to Formulas > Name Manager > New. 2) Enter a name like 'DOUBLE'. 3) In 'Refers to', enter =LAMBDA(x, x*2). 4) Click OK. Now use =DOUBLE(5) anywhere in the workbook, returning 10.
  • Can LAMBDA functions call themselves (recursion)? Yes! Use the name you gave the LAMBDA. Example: Create 'FACTORIAL' as =LAMBDA(n, IF(n<=1, 1, n*FACTORIAL(n-1))). Then =FACTORIAL(5) returns 120. Be careful with recursion depth limits.
  • What is the difference between LET and LAMBDA? LET creates variables within a single formula. LAMBDA creates reusable functions you can call from anywhere. Use LET for one-time complex calculations, LAMBDA for logic you'll reuse across multiple cells or workbooks.

Editorial review

  • Reviewed by Excel.Directory Editorial Team. Updated May 2026.

When to use LAMBDA

  • Custom functions — common Logical scenario for LAMBDA.
  • Reusable logic — common Logical scenario for LAMBDA.
  • Advanced calculations — common Logical scenario for LAMBDA.

LAMBDA in the Logical category

  • Browse all Logical functions at /categories/logical/ for related formulas.
  • LAMBDA syntax: =LAMBDA([parameter1], [parameter2], ..., calculation)
  • parameter1 (optional): First parameter name
  • calculation (required): Formula to execute
  • Confirm LAMBDA arguments match the syntax shown above before filling down.
  • Lock table and range references with $ when copying formulas across rows or sheets.

Formula checklist before you copy down

  • Confirm LAMBDA arguments match the syntax shown above before filling down.
  • Lock table and range references with $ when copying formulas across rows or sheets.
  • If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
  • Spot-check three known input rows manually against expected output.

Related Excel functions

  • LET (/functions/let/): Assigns names to calculation results, allowing you to store intermediate calculations and reuse them.
  • MAP (/functions/map/): Returns an array formed by mapping each value in the array(s) to a new value using a LAMBDA.
  • REDUCE (/functions/reduce/): Reduces an array to an accumulated value by applying a LAMBDA to each value.
  • SCAN (/functions/scan/): Scans an array by applying a LAMBDA to each value and returns an array of intermediate values.

Errors to watch for

  • Must be named in Name Manager for reuse — review causes on linked error pages in the directory.

Copy-paste audit workflow

  • Enter LAMBDA on three test rows with known expected output documented on a QA tab.
  • Fill down only after absolute references are locked on lookup tables and rate tables.
  • Compare against manual calculation or a calculator for financial and statistical functions.
  • Search this directory for comparison guides when choosing between similar functions in the same category.

LAMBDA worked examples to copy

  • =LAMBDA(x, x*2)(5) — Double a number. Expected result: 10.

LAMBDA reference summary for crawlers and offline review

  • LAMBDA belongs to the Logical category in Excel. Creates custom, reusable functions that can be called by a friendly name.
  • Full syntax: =LAMBDA([parameter1], [parameter2], ..., calculation). Open /functions/lambda/ for parameters, FAQs, and related pages.
  • Common mistakes: Must be named in Name Manager for reuse
  • Pair this function with comparison guides when another Excel formula might fit the same task better.
  • Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.