LET function
LET gives names to values or calculations inside a single formula, then uses those names in a final calculation. It makes long formulas readable, and faster when a piece such as a lookup or a total would otherwise be repeated, because LET works it out once and reuses the result.
- Available in
- Excel 2021, 2024 and Microsoft 365
- Category
- Logical functions
- Returns
- The result of the final calculation.
- Google Sheets
- Available in Google Sheets.
Syntax
=LET(name1, value1, [name2, value2], ..., calculation)
| Argument | Required? | What it is |
|---|---|---|
name1 | Required | A name for the first value, such as subtotal. It must start with a letter and can't look like a cell address. |
value1 | Required | The value or calculation to store in name1. |
name2 | Optional | Another name. Add as many name and value pairs as you need. |
value2 | Required | The value or calculation for name2. It can use name1. |
calculation | Required | The final formula, which can use every name defined before it. |
Examples
Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.
| Cell | Formula | Result | What it shows |
|---|---|---|---|
| E2 | =LET(sub,B2*C2,tax,sub*0.08,sub+tax) | $965.52 | Names the subtotal and the tax, then adds them |
| E3 | =LET(total,SUMPRODUCT(B2:B4,C2:C4),IF(total>2000,total*0.95,total)) | $1,962.00 | Works out the order total once and reuses it in the discount test |
| E4 | =LET(top,MAX(B2:B4),mean,AVERAGE(B2:B4),top-mean) | $217.67 | How far the most expensive item is above the average price |
Try it live
This is the sample sheet. Change any number or text, or edit a formula, and the results update.
Show the sample data as a table
| Item | Price | Qty | Result | |
| Chair | $149 | 6 | $965.52 | |
| Desk | $420 | 2 | $1,962.00 | |
| Lamp | $38 | 6 | $217.67 |
Practice LET
From lesson 21, LET. Graded instantly, then re-checked on changed data.
Discounted totals
D2, use LET: subtotal = qty × price; if subtotal is $500 or more, take 10% off. Return the discounted total. Fill down to D6.Common mistakes
| What you see | Why, and how to fix it |
|---|---|
| Names that look like cell addresses | A name such as tax1 or ab12 is also a cell address, so Excel rejects it. Use names like taxRate or sub_total. |
| The last argument isn't a calculation | LET must end with the calculation. If it ends on a name and value pair, Excel says you entered too few arguments. |
| #NAME? | LET needs Excel 2021, Excel 2024 or Microsoft 365. |
Tips
- Name the inputs first and put the logic last, so the final argument reads like a sentence: =LET(rev,B2,cost,C2,(rev-cost)/rev).
- Use LET to avoid repeating a long XLOOKUP inside IF: =LET(p,XLOOKUP(A2,F:F,G:G),IF(p>100,p*0.9,p)).
Questions
What does LET do in Excel?
It assigns names to values within one formula, then returns a final calculation that uses those names.
Does LET make formulas faster?
Yes, when the same calculation would appear more than once. LET works it out once and reuses the result.
Lessons that use LET
- Lesson 21: LET (Pro)
Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.