LET Function in Excel — Define Names Inside Formulas (2026 Guide) | Sheets & Cells
MODERN FUNCTION

LET Function in Excel

LET lets you define named intermediate values inside a formula — like variables in a script. It turns tangled 200-character megaformulas into readable step-by-step calculations, and it makes complex formulas run faster by computing repeated expressions only once. Excel 2021+ / 365.

=LET(name1, value1, [name2, value2, ...], calculation)

What it does: Assigns intermediate values to names, then uses those names in a final calculation. Each name is defined once and can be referenced multiple times in later definitions or in the final calculation. The result of the whole LET is the result of the calculation.

CategoryModern / Logic
IntroducedExcel 365 (2021)
Also inExcel 2021+

What LET does

Complex Excel formulas often use the same subexpression several times. A profit-margin formula might reference SUM(Sales[Amount]) three or four times — once as a divisor, once as a base for percentages, once for display. Without LET, Excel recomputes that SUM every time. With LET, you compute it once, name it "revenue," and reuse the name.

The two benefits: readability (formulas read like a series of named steps) and performance (each named expression is computed only once, no matter how many times you reference it).

Mental model: LET is Excel's version of "let x = 5, let y = 10, return x + y". You're defining local names that only exist inside this one formula. The final argument is always the calculation whose result becomes the formula's answer. Everything before it is a name-value pair setting up variables.

Syntax breakdown

name1 Required

The first variable name. Must start with a letter, can contain letters/numbers/underscores. Cannot conflict with Excel function names (using "SUM" as a LET name will fail). Case-insensitive but conventions matter — lowercase or camelCase are common.

value1 Required

The value or expression that name1 refers to. Can be a literal, a cell reference, a range, or any Excel expression including calls to other functions. Evaluated once when the formula runs.

name2, value2, ... Optional pairs

Additional name-value pairs. Later definitions can reference earlier names — so =LET(x, 5, y, x*2, y+1) works: y is defined using the already-known x. Up to 126 additional pairs.

calculation Required (last argument)

The final expression whose result becomes the LET's result. Uses any of the named values plus any other Excel expressions. The last argument is always the calculation — everything before it is variable definitions.

5 real-world examples

Example 1: Simple name substitution for readability

Without LET, the profit-margin formula: =(SUM(B:B)-SUM(C:C))/SUM(B:B). With LET:

=LET(revenue, SUM(B:B), cost, SUM(C:C), (revenue-cost)/revenue)

Result: Same number, but reads like a definition. Also faster — SUM(B:B) now runs once instead of twice.

Example 2: Chained calculations

Convert Fahrenheit to Celsius, then to Kelvin, showing each step:

=LET(f, A2, c, (f-32)*5/9, k, c+273.15, k)

Result: Kelvin value. Later definitions build on earlier ones. If you need to change the conversion, you edit one place instead of hunting through a nested formula.

Example 3: Reused FILTER for performance

Get the count, sum, and average of active-region sales in one formula:

=LET( activeSales, FILTER(Sales, Sales[Status]="Active"), cnt, ROWS(activeSales), total, SUM(INDEX(activeSales, , 3)), "Count: " & cnt & ", Total: " & total & ", Avg: " & total/cnt)

Result: Formatted string. The expensive FILTER runs once, not three times.

Example 4: Named lookup for cleaner IF logic

Classify a score with named thresholds:

=LET(score, A2, high, 90, low, 60, IF(score>=high, "A", IF(score>=low, "B", "C")))

Result: "A", "B", or "C". If you need to change the thresholds, you edit them at the top of the formula — obvious and centralized.

Example 5: LET inside a LAMBDA for reusable logic

Wrap a complex calculation as a named LAMBDA, using LET internally:

=LAMBDA(price, taxRate, LET(tax, price*taxRate, total, price+tax, total))

Result: Save this as a Name Manager entry called PriceWithTax, then use =PriceWithTax(100, 0.08) anywhere. The internal LET makes the LAMBDA's logic clear.

Common errors and how to fix them

#NAME?

Usually means either (1) your Excel version doesn't have LET (pre-2021 versions), or (2) you used a name that conflicts with an Excel function name like SUM or IF. Rename your variable to something unique like mySum.

#VALUE!

Odd number of arguments — LET requires pairs of name-value plus a final calculation. Count your arguments: it should always be even (pairs) plus one (the final calculation). Missing the final calculation is the most common cause.

Name used before it's defined

You can reference earlier names in later definitions, but not the other way around. =LET(x, y*2, y, 5, x) fails because y is used before it's defined. Reorder: =LET(y, 5, x, y*2, x).

Formula returns nothing or wrong value

You forgot the final calculation and instead ended with a name-value pair. Remember: the last argument is always the expression to return, not a definition. =LET(x, 5, y, 10) is invalid — needs =LET(x, 5, y, 10, x+y).

LET vs alternatives

ApproachBest forTrade-off
LETNamed intermediate values in one formulaExcel 2021+ / 365 only
Helper cellsValues that other formulas also needClutters the sheet with intermediate values
Named Ranges (Name Manager)Values used across many formulasGlobal scope; changes affect everything
LAMBDAReusable logic across formulasMore complex; needs Name Manager to be useful
Long nested formulaPre-2021 compatibilityHard to read; expressions recomputed

Version compatibility

Excel 365✓ Full
Excel 2024✓ Full
Excel 2021✓ Full
Excel 2019✗ Not available
Excel 2016✗ Not available
Excel Online✓ Full
Excel Mac✓ Full
Google Sheets✓ Full

Download the practice workbook
Every example above, plus before/after comparisons showing LET refactors of typical tangled formulas.

📥 let-practice.xlsx (coming soon)

Related functions

Frequently asked questions

Does LET make my formulas faster?

Yes, when the same expression is used multiple times. Without LET, Excel recomputes each reference independently. With LET, the expression is evaluated once and the result is reused. Speedups can be dramatic when the repeated expression is a large FILTER, VLOOKUP, or aggregation.

Can I use LET names across different cells?

No — LET names are local to the single formula they're defined in. For names shared across many formulas, use the Name Manager (Formulas → Name Manager) to create workbook-scope named ranges instead.

How many name-value pairs can LET have?

Up to 126 name-value pairs, plus the final calculation. In practice, if you need more than 5-6, consider breaking the formula into multiple cells or extracting reusable logic into a LAMBDA.

Can LET names contain spaces or special characters?

No. Names must start with a letter or underscore and contain only letters, numbers, and underscores. Use camelCase (myRevenue) or snake_case (my_revenue) for multi-word names.

Can LET be used inside another LET?

Yes — nested LET works. But if you find yourself nesting LETs, consider whether the outer LET's names should be reused instead. Deeply nested LETs are usually a sign the formula should be a LAMBDA saved in the Name Manager.

What happens if I define the same name twice?

The later definition overrides the earlier one for any references that follow it. Better practice: don't reuse names within a single LET — pick different names for clarity.

Is LET the same as a variable in programming?

Conceptually yes — it's a way to bind a value to a name for reuse in later expressions. Unlike programming variables, LET names are immutable within the formula's scope — you can't reassign them. Each name is defined once and referenced many times.

Refactor tangled formulas into readable LET expressions — with the Sheets & Cells AI Add-in

Highlight any long formula and the Add-in rewrites it with LET, naming the reused subexpressions and improving both readability and performance. All inside Excel.

Learn about the Add-in →