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.
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.
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).
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:
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
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.
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.
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).
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
| Approach | Best for | Trade-off |
|---|---|---|
| LET | Named intermediate values in one formula | Excel 2021+ / 365 only |
| Helper cells | Values that other formulas also need | Clutters the sheet with intermediate values |
| Named Ranges (Name Manager) | Values used across many formulas | Global scope; changes affect everything |
| LAMBDA | Reusable logic across formulas | More complex; needs Name Manager to be useful |
| Long nested formula | Pre-2021 compatibility | Hard to read; expressions recomputed |
Version compatibility
Download the practice workbook
Every example above, plus before/after comparisons showing LET refactors of typical tangled formulas.
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 →