# LET function in Excel

> LET gives names to values or calculations inside a single formula, then uses those names in a final calculation.

Source: https://spreadsheetpractice.com/functions/let · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** LET gives names to values or calculations inside a single formula, then uses those names in a final calculation.
- **Syntax:** `=LET(name1, value1, [name2, value2], ..., calculation)`
- **Most common use:** `=LET(sub,B2*C2,tax,sub*0.08,sub+tax)` returns $965.52 (Names the subtotal and the tax, then adds them)
- **Available in:** Excel 2021, 2024 and Microsoft 365
- **Category:** [Logical functions](https://spreadsheetpractice.com/functions/category/logic)
- **Returns:** The result of the final calculation.
- **Google Sheets:** Available in Google Sheets.

## What it does

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.

## 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 was calculated by running the formula on the sample sheet.

| 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 |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Item | Price | Qty |  | Result |
| 2 | Chair | $149 | 6 |  | $965.52 |
| 3 | Desk | $420 | 2 |  | $1,962.00 |
| 4 | Lamp | $38 | 6 |  | $217.67 |

## 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)).

## Related functions

- [IF](https://spreadsheetpractice.com/functions/if): IF checks a condition and returns one value when it is true and another when it is false.
- [XLOOKUP](https://spreadsheetpractice.com/functions/xlookup): XLOOKUP searches one column or row for a value and returns the matching item from another.
- [SUMPRODUCT](https://spreadsheetpractice.com/functions/sumproduct): SUMPRODUCT multiplies matching items in two or more ranges and adds the results.

## 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.

## Practice

A graded LET exercise ("Discounted totals") is on [the LET page](https://spreadsheetpractice.com/functions/let). It is checked instantly, then re-checked on changed data.

Lessons that use LET:

- [Lesson 28: LET](https://spreadsheetpractice.com/learn/let-function) (Pro)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
