LET

Name intermediate values inside a formula with LET so long calculations are easier to read and faster to run.

|
Excel 2021+
|
Google Sheets Supported

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

The LET function lets you assign names to values or calculations inside a single formula, then reuse those names in the final result. Instead of repeating the same expression several times, you define it once, give it a clear name, and reference that name wherever you need it. This turns a wall of nested functions into a series of readable, named steps.

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.

Examples

Percentage-of-total column

See how LET names the grand total once and reuses it to find each region's share. Change a sales figure and watch every percentage recalculate.

Spreadsheet editor

Reuse a value with IF

Name the sales figure once, then reuse it in the test and both bonus rates. Edit the threshold and notice you only have to change the rule in one place.

Spreadsheet editor

Chain named steps

Watch how each name builds on the one before it: gross, then tax, then net. Change the gross pay or tax rate and the whole calculation follows along.

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.

Tips & notes

LET supports up to 126 name/value pairs, but a handful of well-named steps usually keeps things clearest. You can reference an earlier name inside a later value, which lets you build calculations step by step. Use short, meaningful names so the formula reads almost like a sentence.

Common questions

Does LET make my formulas faster?

It can. Excel calculates each named value once and reuses the result, so naming an expensive lookup or array operation instead of repeating it cuts down on duplicate work.

What's the difference between LET and LAMBDA?

LET names values inside a single formula for readability. LAMBDA creates a reusable, named custom function you can call from anywhere in the workbook. They often work well together.

Can I use one LET variable inside another?

Yes. Each name can reference names defined before it, so you can chain steps like total, then share = value / total, then a final rounded result.

Why am I getting a #NAME? error?

Either your Excel version doesn't support LET (it needs Microsoft 365 or Excel 2021), or you used a variable name that clashes with a cell reference style. Rename the variable and try again.