LET
Name intermediate values inside a formula with LET so long calculations are easier to read and faster to run.
Spreadsheet editor
Spreadsheet editor
Syntax
=LET(name1, value1, calculation_or_name2, [value2], ...)
Returns: Varies Arguments
| Argument | Required | Description |
|---|---|---|
| name1 | Yes | The first variable name you want to define. It must start with a letter and cannot look like a cell reference (so names like C or R1 are not allowed). |
| value1 | Yes | The value, range, or calculation assigned to the first name. |
| calculation_or_name2 | Yes | Either the final calculation that uses your defined names, or a second name to define. The very last argument is always a calculation that returns the result, using one or more of the names you defined. |
| value2 | No | The value, range, or calculation assigned to a second name when calculation_or_name2 is used as a name rather than the final calculation. Name/value pairs repeat up to 126 times. |
About
Use LET when a formula is hard to follow or recalculates the same thing more than once. Naming each piece makes the logic easier to audit and change later, and because Excel calculates each named value only once, your formula can run faster too. LET pairs especially well with dynamic arrays like FILTER and SORT, where you often want to store a filtered result before working with it.
Names live only inside the formula that creates them, so they never clash with workbook names or other formulas. For reusable, named custom functions across a workbook, look at LAMBDA instead.
Exercises using LET
LET with nested dynamic arrays
AdvancedBuild one readable spill formula that creates a merchandising snapshot by filtering, sorting, and returning selected review columns.
Open exerciseSimplify a complex formula with LET
AdvancedRefactor a repeated commission formula into named steps that are easier to audit.
Open exerciseExamples
Percentage-of-total column
Spreadsheet editor
Reuse a value with IF
Spreadsheet editor
Chain named steps
Spreadsheet editor
Watch out for
The last argument must be a calculation
Ending LET on a name/value pair (with no final expression) returns a #VALUE! or similar error because Excel has nothing to output.
→ Always finish with a calculation that uses your names. The final argument should return the actual result, not just define another variable.
Names that look like cell references
Using a name like C, R, or A1 fails because Excel reads it as a reference instead of a variable.
→ Pick descriptive names that start with a letter and don't match the A1 or R1C1 reference style.
Expecting names to work outside the formula
Variables created in LET only exist inside that one formula, so referencing them from another cell returns an error.
→ Keep each LET self-contained. If you need a name available across the sheet, define it in the Name Manager or build a reusable function with LAMBDA.
Using LET in older Excel versions
LET only works in Excel for Microsoft 365 and Excel 2021. Opening the file in Excel 2019 or earlier shows a #NAME? error.
→ If you share workbooks with people on older versions, replace LET with the full expressions or use IF and helper cells instead.