Writing LET and LAMBDA formulas can be difficult when you are not familiar with their syntax. Copilot in Excel can write LET and LAMBDA formulas from a plain-language description. In this article, you will learn how to create LET and LAMBDA formulas with Copilot in Excel.
Key Takeaways:
- LET assigns names to calculations within an Excel formula.
- LAMBDA helps create reusable custom functions without VBA.
- Copilot can generate LET formulas using plain-language prompts.
- Use Copilot to create LAMBDA functions with custom parameters.
- Test the suggested formulas before using them in your workbook.
Table of Contents
Introduction to LET and LAMBDA Functions
What is LET Function?
With LET, you can give a calculation a name and use that name again within the same formula. The syntax of the function is:
=LET (name1, value1, [name2], [value2], calculation)
- name1 – the name of the first variable defined;
- value1 – the value assigned to the first name;
- name2 – the name of the second variable (optional);
- value2 – the value assigned to the second name (optional);
- calculation – the expression or formula that uses these defined variables.
For example:
=LET(x, 5, y, 9, x+y/x)
In this example, x gets the value 5, and y gets 9. Excel uses these values to calculate the result.
=5+9/5
=6.8
What is LAMBDA Function?
LAMBDA turns a regular Excel formula into a custom function that you can reuse with different inputs. The syntax of this function is:
=LAMBDA(parameter1, parameter2, …, calculation)
- parameter(s) – The value you want to use in the calculation.
- calculation – The formula you want Excel to execute.
For example, to convert pounds to dollars using LAMBDA, use this formula:
=LAMBDA (pound, conversion, pound*conversion)(B6,C6)
How to Create LET and LAMBDA Formulas with Copilot
LET Formula with Copilot
Assume column A contains product prices and column B contains quantities. You need to calculate the sales amount after deducting a 10% discount. Ask Copilot to create a LET formula and assign names to the intermediate calculations.
STEP 1: Select the data in your Excel workbook.
STEP 2: Go to the Home tab and click the Copilot button.
STEP 3: Enter the following prompt in the Copilot pane:
“Create a LET formula to calculate the total sales after a 10% discount. Use the price in column A and quantity in column B. Assign names to the subtotal and discount calculations.”
STEP 4: Copilot will suggest a LET formula based on your prompt.
Review the formula and insert it into the worksheet.
LAMBDA Formulas with Copilot
When you calculate discounted prices frequently, you can save the calculation as a LAMBDA function and reuse it with different values. In the Copilot pane, enter this prompt:
“Create a LAMBDA function that accepts price and discount percentage as inputs and returns the final price after applying the discount.”
You can test the formula by passing values directly to it:
=LAMBDA(price,discount,price*(1-discount))(1000,10%)
The result will be 900.
The name is stored in Formulas > Name Manager. It takes the price and the discount percentage and returns the price after the discount. You can now use the custom function in your worksheet.
Tips & Tricks
- Mention LET or LAMBDA in your prompt so Copilot knows which function to use.
- Choose meaningful names for calculations and parameters.
- Use LET to organize formulas that contain repeated calculations.
- Ask Copilot to explain the suggested formula if you are unsure how it works.
- Try the formula with different values to check the results.
FAQs
1. What is the difference between LET and LAMBDA in Excel?
LET assigns names to calculations within a formula, while LAMBDA creates reusable custom functions.
2. Can Copilot create LET formulas in Excel?
Copilot can suggest LET formulas based on your calculation requirements and instructions.
3. Can Copilot create custom LAMBDA functions?
Copilot can generate LAMBDA formulas that you can save in Name Manager and reuse in your workbook.
4. Do I need VBA to create LAMBDA functions?
No. LAMBDA allows you to create custom functions using Excel formulas without writing VBA code.
5. Can I use LET and LAMBDA together in Excel?
Yes. You can use LET inside a LAMBDA function to assign names to intermediate calculations and make the formula easier to manage.
John Michaloudis is a former accountant and finance analyst at General Electric, a Microsoft MVP since 2020, an Amazon #1 bestselling author of 4 Microsoft Excel books and teacher of Microsoft Excel & Office over at his flagship MyExcelOnline Academy Online Course.





