What LET does
LET gives a value or calculation a name inside one formula. You can then use that name in the final calculation, making a repeated expression easier to follow. The name belongs to that LET formula; it doesn't create a workbook name.
Start with a name and its value, add any other name/value pairs you need, and finish with the calculation you want Excel to return.
Practical examples
Calculate a price including a rate
This example supplies its inputs directly: a price of 80 and a rate of 7.5%. Enter the formula in any empty cell:
=LET(price,80,rate,7.5%,price*(1+rate))FormulaThe expected result is 86. LET assigns 80 to price and 7.5% to rate, then calculates 80 × 1.075. The last argument returns the price including the rate.
Name a sales total before checking a discount
Enter this source data in A1:C8:
| Region | Product | Sales |
|---|---|---|
| North | Tea | 120 |
| South | Tea | 90 |
| North | Coffee | 150 |
| North | Accessories | 40 |
| South | Coffee | 110 |
| North | Tea | 80 |
| South | Tea | 130 |
Put North in E2, Tea in F2, the threshold 200 in K2, and the discount rate 10% in L2. In H2, enter:
=LET(total,SUMIFS($C$2:$C$8,$A$2:$A$8,E2,$B$2:$B$8,F2),IF(total>=$K$2,total*$L$2,0))FormulaThe expected result is 20. SUMIFS finds the two North/Tea sales, 120 and 80. LET names their sum total. IF checks whether 200 meets the threshold and returns 200 × 10%.
You can use total in both the comparison and the discount calculation without writing SUMIFS twice. The LET walkthrough compares the original formula with this version and shows how to return the intermediate total while checking your work.
Common mistakes and notes
Finish with a calculation
The final argument must return a result. A name/value pair alone isn't a complete LET formula. You need at least one pair, and LET supports up to 126 pairs.
The optional arguments in the syntax allow more pairs. Once you supply another name, its value and a later final calculation are required.
Choose names Excel can recognize
Names must start with a letter and must not conflict with range references. Use a descriptive name such as total. Microsoft flags c as a potential conflict with R1C1 reference syntax, so avoid it even if your Excel setup accepts it.
Keep formula names separate from reusable functions
The names exist only inside their LET formula. Copying the formula creates another calculation with its own names; relative cell references still move as usual. For a calculation you want to call by name elsewhere in a workbook, see LAMBDA.
Check the calculation you assigned
Naming an expression doesn't correct its logic or hide its errors. In the sales example, >= includes a total exactly equal to the threshold. Change the threshold to 201 and the North/Tea discount becomes 0.