The LET function in Excel
LET works like variables in a formula: you give a name to a value, then use the name as many times as you like. The last argument is the calculation that returns the result.
It makes long formulas shorter, easier to check and faster, because a repeated calculation is done once. It is available in Excel 2021, Excel 2024 and Microsoft 365.
Syntax
=LET(name1, value1, [name2, value2, …], calculation)
| Argument | What it means |
|---|---|
| name1 | The first name. It must start with a letter and can't look like a cell reference. |
| value1 | The value or calculation that the name stands for. |
| name2, value2, …optional | More name and value pairs. A value can use the names defined before it. |
| calculation | The last argument: the formula that uses the names and returns the result. |
Examples
1. Average from a total and a count
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Day | Sales | Average | |
| 2 | Mon | 10 | 20 | |
| 3 | Tue | 20 | ||
| 4 | Wed | 30 |
s is the total (60) and n the count (3), so the result s/n reads like a sentence.
2. A discounted price
| A | B | |
|---|---|---|
| 1 | Price | 80 |
| 2 | Discount | 0.25 |
| 3 | Final | 60 |
Names such as price and rate say what each cell means, which is easier than B1 and B2.
3. Reusing a calculation
| A | B | |
|---|---|---|
| 1 | Units | 50 |
| 2 | Price | 4 |
| 3 | Total with 10% fee | 220 |
x is calculated once (200) and used twice: 200 + 20.
Common mistakes
A name that looks like a cell. Names such as x1 or tax2024 are rejected.
Fix: Use descriptive names like total or rate.
Forgetting the final calculation. A LET that ends with a name and a value but no calculation returns an error.
Fix: The last argument must be the formula that produces the result.
Frequently asked questions
Do the names exist outside the formula?
No. They only exist inside the LET that defines them. For names you want to reuse across the workbook, use named ranges.
Is LET faster?
Often, when a heavy calculation is used more than once, because it is done only one time.
Related functions
- FILTERFILTER returns the rows of a range that meet a condition, and spills them into the cells below.
- XLOOKUPXLOOKUP searches one column or row and returns the matching value from another, in any direction, with a built-in 'not found' message.
- IFIF checks a condition and returns one value if it's true and another if it's false.