Complex Excel formulas often repeat the exact same calculation two or three times—such as running the same XLOOKUP inside an IF test and again in the output, or dividing sales by quota three times to check commission tiers. With the LET function in Excel, you can assign readable variable names to intermediate results inside a single formula, making long expressions easier to read and up to twice as fast to calculate.
Availability & Compatibility: Per the official LET function documentation, LET is available in Excel for Microsoft 365 (Windows and Mac), Excel for the web, Excel 2024, and Excel 2021 (as well as Google Sheets). Older perpetual releases such as Excel 2019 and Excel 2016 do not support LET and will display #NAME?.
Table of Contents
How the LET Function in Excel Works (Syntax & Variable Rules)
LET lets you declare up to 126 name-and-value pairs inside a formula, followed by one final calculation that uses those names. Every variable stays scoped strictly to that single cell, so it never clutters your workbook’s Name Manager. Here is the syntax:
=LET(name1, name_value1, calculation_or_name2, [name_value2, calculation_or_name3...])
- name1 (Required): The first variable name to assign. It must start with a letter and cannot match a cell reference (like
A1orR1) or R1C1 shorthand (likecorr). - name_value1 (Required): The number, text, range, or sub-formula assigned to
name1. - calculation_or_name2 (Required): Either the final calculation returning the cell’s result, or a second variable name.
- Additional pairs (Optional): Up to 126 total name/value pairs, always ending with a single calculation argument.
Step-by-Step Example: Tiered Sales Commissions With LET
Suppose your Practice sheet tracks Q4 SaaS sales reps in A6:D11, with Quarterly Sales in Column C and Quota in Column D. You want to pay a 12% commission for 120%+ quota attainment, 8% for 100%+ attainment, and 3% below quota. Without LET, you must repeat C6/D6 twice inside nested IF statements:
=IF(C6/D6>=1.2, 0.12, IF(C6/D6>=1, 0.08, 0.03)) * C6
Using LET, we calculate quota attainment once as att, store the resulting tier rate as rate, and multiply by sales at the end:
=LET(att, C6/D6, rate, IF(att>=1.2, 0.12, IF(att>=1, 0.08, 0.03)), C6*rate)
For Maya Lin ($145,000 sales vs. $115,000 quota), att evaluates once to 126.1%, rate resolves to 12%, and Excel returns $17,400. Even better, when you wrap an expensive XLOOKUP in Excel or FILTER call inside a LET variable, Excel executes the lookup only once instead of repeating it for every branch. You can also combine LET with LAMBDA in Excel to build readable reusable custom functions.
LET vs. Helper Columns vs. Name Manager
Use this comparison table to decide when LET is the cleanest architectural choice:
| Feature | LET Function | Helper Columns | Name Manager |
|---|---|---|---|
| Scope | Single cell formula only | Visible across sheet | Entire workbook |
| Recalculation Speed | Evaluates each variable once | Fast, but adds grid clutter | Global overhead |
| Portability | Copy-paste formula anywhere | Breaks if columns move | Requires copying names |
| Best For | Self-contained multi-step formulas | Auditing intermediate steps | Workbook-wide constants |
Troubleshooting #NAME?, #VALUE!, and #SPILL! Errors
- Formula won’t accept variable name ‘c’ or ‘r’: Per Microsoft Support, names that conflict with R1C1-style references (
candr) or A1 cell coordinates (q1,fy26) are invalid. Use descriptive names likerate,qtr_one, oratt. - Odd number of arguments error: Every variable name needs a matching value, and the very last argument must be a calculation—never a trailing variable name without a final expression.
- #NAME? error: Either you referenced a variable name that wasn’t declared earlier in the same
LETcall, or the workbook was opened in Excel 2019 or older. - #SPILL! error: If your final calculation returns a dynamic array (such as a filtered table), clear any obstructing cells in the output path—see our guide on how to fix the #SPILL! error in Excel.
Frequently Asked Questions
What does the LET function do in Excel?
LET lets you assign names to intermediate values or calculations inside a single formula, improving readability and preventing Excel from recalculating repeated expressions multiple times.
How many variables can I define in one LET formula?
You can define up to 126 name-and-value pairs inside a single LET function, ending with one final calculation argument.
Why won’t Excel let me name a variable ‘c’ or ‘Q1’ in LET?
LET follows Excel Name Manager rules: variable names must start with a letter and cannot conflict with A1 cell addresses (like Q1) or R1C1 references (like c or r).
Can a LET variable reference an earlier variable in the same formula?
Yes. Variables are evaluated sequentially from left to right, so later variables (like rate) can reference earlier variables (like att) in the same LET call.
Does LET work in Excel 2021 and Google Sheets?
Yes. LET is supported in Excel 2021, Excel 2024, Excel for Microsoft 365, Excel for the web, and Google Sheets. It is not supported in Excel 2019 or earlier.
Download the practice workbook
The same data as this tutorial, with empty answer cells and a Solutions sheet.