Logical Excel 365 ◉ 35 views

=LAMBDA()

LAMBDA function

Applies To: Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for Mac
=LAMBDA([parameter1, parameter2, …,] calculation)
Hover argument names in the table for details.
Output typeMixed
Popularity50 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =LAMBDA() with Persian sample data & live formulas — open in Excel and practice.

  • Sheet “Sample” — data table + formula in place
  • Sheet “Guide” — syntax, arguments & tips from this page
  • Instant & secure (token + rate limit)
Download LAMBDA.xlsx ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
parameter Text Optional A value that you want to pass to the function, such as a cell reference, string or number. You can enter up to 253 parameters. This argument is
calculation Any type Required The formula you want to execute and return as the result of the function. It must be the last argument and it must return a result. This argument is

▣ Examples

▦ Data
CellValue
A2 Name:
B2 ToCelsius
A3 Scope:
B3 Workbook
A4 Comment:
B4 Convert a Fahrenheit temperature to Celsius
A5 Refers to:
B5 =LAMBDA(temp, (5/9) * (Temp-32))
A6 104
A7 86
A8 68
A9 50
A10 32
A11 Name:
B11 Hypotenuse
A12 Scope:
B12 Workbook
A13 Comment:
B13 Returns the length of the hypotenuse of a right triangle
A14 Refers to:
B14 =LAMBDA(a, b, SQRT((a^2+b^2)))
A15 3
B15 4
A16 5
B16 12
A17 7
B17 24
A18 9
B18 40
A19 Name:
B19 CountWords
A20 Scope:
B20 Workbook
A21 Comment:
B21 Returns the word count in a text string
A22 Refers to:
B22 =LAMBDA(text, LEN(TRIM(text)) - LEN(SUBSTITUTE(TRIM(text), " ", "")) + 1)
A23 Something wicked this way comes.
A24 I came, I saw, I conquered.
A25 A quick brown fox jumped over the lazy dog.
A26 Use the Force, Luke!
A27 Name:
B27 ThanksgivingDate
A28 Scope:
B28 Workbook
A29 Comment:
B29 Returns the date Thanksgiving in the USA falls on for a given year
A30 Refers to:
A31 2020
A32 2021
A33 2022
A34 2023
A35 2024
A36 Name:
B36 ToCelsius
A37 Scope:
B37 Workbook
A38 Comment:
B38 Convert a Fahrenheit temperature to Celsius
A39 Refers to:
B39 =LAMBDA(temp, (5/9) * (Temp-32))
A40 104
A41 86
A42 68
A43 50
A44 32
A45 Name:
B45 Hypotenuse
A46 Scope:
B46 Workbook
A47 Comment:
B47 Returns the length of the hypotenuse of a right triangle
A48 Refers to:
B48 =LAMBDA(a, b, SQRT((a^2+b^2)))
A49 3
B49 4
A50 5
B50 12
A51 7
B51 24
A52 9
B52 40
A53 Name:
B53 CountWords
A54 Scope:
B54 Workbook
A55 Comment:
B55 Returns the word count in a text string
A56 Refers to:
B56 =LAMBDA(text, LEN(TRIM(text)) - LEN(SUBSTITUTE(TRIM(text), " ", "")) + 1)
A57 Something wicked this way comes.
A58 I came, I saw, I conquered.
A59 A quick brown fox jumped over the lazy dog.
A60 Use the Force, Luke!
A61 Name:
B61 ThanksgivingDate
A62 Scope:
B62 Workbook
A63 Comment:
B63 Returns the date Thanksgiving in the USA falls on for a given year
A64 Refers to:
A65 2020
A66 2021
A67 2022
A68 2023
A69 2024
40 =TOCELSIUS(A2)
30 =TOCELSIUS(A3)
20 =TOCELSIUS(A4)
10 =TOCELSIUS(A5)
تبدیل ۳۲ درجه فارنهایت به سلسیوس =TOCELSIUS(A6)
5 =HYPOTENUSE(A2,B2)
13 =HYPOTENUSE(A3,B3)
25 =HYPOTENUSE(A4,B4)
41 =HYPOTENUSE(A5,B5)
5 =COUNTWORDS(A2)
6 =COUNTWORDS(A3)
9 =COUNTWORDS(A4)
4 =COUNTWORDS(A5)
11/26/2020 =THANKSGIVINGDATE(A2)
11/25/2021 =THANKSGIVINGDATE(A3)
11/24/2022 =THANKSGIVINGDATE(A4)
11/23/2023 =THANKSGIVINGDATE(A5)
11/28/2024 =THANKSGIVINGDATE(A6)

§ Remarks

  • Lambda names and parameters follow the Excel syntax rules for names, with one exception: don't use a period (.) in a parameter name. For more information, see Names in formulas.
  • Make sure you follow best practices when creating a LAMBDA function as you do with any native Excel formula, such as passing of the correct number and type of arguments, matching open and close parentheses, and entering numbers as unformatted . Also, when you use the Evaluate command, Excel immediately returns the result of the LAMBDA function and you can't step into it. For more information, see Detect errors in formulas.

✦ Tips

  • Lambda names and parameters follow the Excel syntax rules for names, with one exception: don't use a period (.) in a parameter name. For more information, see Names in formulas.
  • Make sure you follow best practices when creating a LAMBDA function as you do with any native Excel formula, such as passing of the correct number and type of arguments, matching open and close parentheses, and entering numbers as unformatted . Also, when you use the Evaluate command, Excel immediately returns the result of the LAMBDA function and you can't step into it. For more information, see Detect errors in formulas.

⚠ Common Errors

#VALUE! If you enter more than 253 parameters, Excel returns a #VALUE! error. If an incorrect number of arguments is passed to a LAMBDA function, Excel returns a #VALUE! error.
Fix: تعداد پارامترها را به ۲۵۳ یا کمتر محدود کنید و مطمئن شوید هنگام فراخوانی دقیقاً به تعداد پارامترهای تعریف‌شده مقدار می‌دهید.
#NUM! If you call a LAMBDA function from within itself and the call is circular, Excel can return a #NUM! error if there are too many recursive calls.
Fix: شرط خروج بازگشت را بررسی و اصلاح کنید تا حلقه بی‌نهایت ایجاد نشود.
#CALC! If you create a LAMBDA function in a cell without also calling it from within the cell, Excel returns a #CALC! error.
Fix: Add the inputs in parentheses after the formula

💬 Comments & Q&A 0 approved

🔒 Your comment will be published after review.

Share your thoughts — visible after admin approval

No comments yet — be the first!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.