LAMBDA Function

Excel 365

Summary

The LAMBDA function enables users to create custom, reusable functions directly in Excel formulas without VBA or macros. Define parameters and calculations once, then call by name throughout the workbook like native functions.

Syntax

LAMBDA([parameter1, parameter2, …], calculation)

Parameters

Parameter Type Required Description
parameters Any No Optional list of up to 253 input parameters for the custom function
calculation Any Yes Required calculation formula using the defined parameters

Using the LAMBDA Function

LAMBDA revolutionizes Excel by letting anyone create custom functions. Test in cells first, then register via Name Manager for workbook-wide use. Perfect for repetitive calculations, complex conversions, or specialized business logic.

Common LAMBDA Examples

Fahrenheit to Celsius Converter

=LAMBDA(temp, (5/9)*(temp-32))

Define in Name Manager as 'ToCelsius'. Usage: =ToCelsius(104) returns 40.

Hypotenuse Calculator

=LAMBDA(a,b,SQRT(a^2+b^2))

Define as 'Hypotenuse'. Usage: =Hypotenuse(3,4) returns 5.

Word Counter

=LAMBDA(text,LEN(TRIM(text))-LEN(SUBSTITUTE(TRIM(text)," ",""))+1)

Define as 'CountWords'. Usage: =CountWords("Hello world") returns 2.

Thanksgiving Date Finder

=LAMBDA(year,TEXT(DATE(year,11,CHOOSE(WEEKDAY(DATE(year,11,1)),26,25,24,23,22,28,27)),"mm/dd/yyyy"))

Define as 'ThanksgivingDate'. Usage: =ThanksgivingDate(2024) returns "11/28/2024".

Frequently Asked Questions

Define it in Name Manager (Formulas > Name Manager > New) with workbook scope.

LAMBDA must be called immediately in the same cell during testing, e.g., =LAMBDA(x,x+1)(5).

Yes, LAMBDA supports all Excel functions within the calculation parameter.

Common Errors and Solutions

#VALUE!

Cause: More than 253 parameters or wrong argument count

Solution: Limit to 253 parameters max and match exact count.

#NUM!

Cause: Circular reference from recursive calls

Solution: Avoid infinite recursion or add termination conditions.

#CALC!

Cause: LAMBDA defined but not called in same cell

Solution: Add function call: =LAMBDA(...)(args).

#VALUE!

Cause: Period (.) in parameter names

Solution: Use underscores or no special characters in param names.

Notes

  • Test LAMBDA formulas in cells before Name Manager
  • Parameter names follow Excel name rules (no periods)
  • Use Evaluate tool shows final result only
  • Ideal companion for LET function
  • Available only in Excel 365

Compatibility

Available in: Excel 365, Excel for Microsoft 365

Not available in: Excel 2021, Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007, Excel for web (limited), Excel for Mac (limited)

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 365