In Excel, a LET formula showing #NAME? usually contains a name Excel cannot recognize, or it is being opened in an Excel version that does not support LET. Check that LET is available, then inspect every variable name and any names used in the final calculation; the examples below show how to pinpoint the problem.
What the LET function does
LET lets you assign names to values or calculations inside a formula, then refer to those names later in that same formula. It can make a long formula easier to read and can prevent Excel from calculating the same expression repeatedly. The names are local to the LET formula: defining sales inside one formula does not create a workbook-wide name called sales.
The structure is a sequence of name-and-value pairs followed by one final calculation. For example, with no worksheet cells required, this formula assigns 10 to itemCount and returns 11:
=LET(itemCount,10,itemCount+1)
For a worksheet example, with revenue in B2 and cost in C2, where B2 contains 1250 and C2 contains 800, this formula returns 450:
=LET(revenue,B2,cost,C2,revenue-cost)
Each name must be followed by its value, and the final argument must be a calculation or value to return. In the second example, revenue is paired with B2, cost is paired with C2, and revenue-cost is the final calculation.
What #NAME? means in a LET formula
#NAME? means Excel has encountered a name or function it does not recognize. It is not a message that specifically means LET is broken: the unknown item could be LET itself, a misspelled variable, or a name used in the calculation but never defined. Excel may also return this error when a formula refers to a named range that does not exist.
For example, with revenue in B2 and cost in C2, this formula refers to expenses without defining it as a LET name or pointing to a worksheet cell. Excel cannot resolve that name, so the formula returns #NAME?:
=LET(revenue,B2,cost,C2,revenue-expenses)
Changing expenses to cost fixes the undefined-name problem. If the formula is already correct and the error appears only on another computer, the Excel version is a likely cause.
Check whether your Excel version supports LET
LET is available in Microsoft 365 and Excel 2021 or later, including current versions of Excel for Mac and Excel for the web. Older releases, such as Excel 2019 and Excel 2016, do not support the function. Opening a workbook with a LET formula in an unsupported release can produce #NAME?; Excel may also show an _xlfn. prefix in the formula to indicate an unrecognized function.
On Windows, check the installed release using File > Account > About Excel. To look for an update, use File > Account > Update Options > Update Now, if that option is available. On Mac, check Excel > About Microsoft Excel; updates are generally managed through Help > Check for Updates. Organizations may control updates centrally, so an update option can be unavailable.
Be precise about which Excel is installed: having an Office or Microsoft 365 account does not necessarily mean the computer is running a current build. If you cannot update the version, replace LET with a conventional formula or open the workbook in a supported release. A newer Excel version may calculate LET formulas but does not make the function usable in older software that later opens the file.
Check LET syntax and argument order
A LET formula needs at least three arguments: a name, the value assigned to that name, and the final calculation. Additional names must each have their own value. In a formula with multiple assignments, keep the pairs in order and make sure the final argument is the result you want, not another unpaired name.
For example, with quantity in A2 and unit price in B2, this formula assigns a name to each input and returns their product:
=LET(quantity,A2,unitPrice,B2,quantity*unitPrice)
If A2 is 4 and B2 is 12, the result is 48. The formula has two complete pairs—quantity and A2, then unitPrice and B2—followed by quantity*unitPrice. A missing comma, a missing value, or an extra argument can instead cause Excel to reject the formula or return another error. Not every syntax problem produces #NAME?.
In English-language Excel settings, formulas commonly use commas between arguments, as in the examples here. Some regional settings use semicolons instead. If Excel will not accept a formula as entered, check the argument separator used by your installation. A separator mismatch is more likely to trigger a formula-entry or syntax complaint than a genuine unknown-name error.
Review variable names and workbook names
LET names must follow Excel’s naming rules. Use a simple name made from letters, numbers, and underscores, such as annualSales or tax_rate. Do not include spaces or make a name look like a cell reference such as A1. Choosing clear names also makes it easier to spot a typo when reading a long formula.
Excel does not treat variable names as case-sensitive, so Revenue and revenue refer to the same name. However, spelling still matters: netRevenue and netRevenues are different names. Check that each name used in the final calculation matches a name declared earlier, and that a name has not accidentally been typed as ordinary text without quotation marks or as a reference that does not exist.
Also distinguish a LET variable from a defined name. A defined name is created for use across a workbook or within a sheet; a LET variable exists only within its own formula. If a formula expects a workbook name such as TaxRate, confirm that it exists in Formulas > Name Manager. If you meant to use a local LET variable, declare it in the formula before using it.
Separate #NAME? from other formula errors
When a LET formula fails, identify the actual error before changing it. Similar-looking formula problems have different causes, and replacing names at random can hide the original issue.
#NAME?points to an unrecognized function or name, such as an unsupported LET function or an undefined variable.#VALUE!generally indicates a problem with the type or value used in a calculation, rather than simply an unknown name.#REF!indicates an invalid cell reference, often because a referenced cell, row, or column was deleted.- A formula-entry warning or a message about too few arguments suggests checking parentheses, separators, and the order of LET pairs.
For example, if LET works in a small test but the full formula returns #NAME?, support for the function itself is less likely to be the issue. Look for a misspelled variable, a missing defined name, or an unsupported function elsewhere in the expression. If the error appears in every LET formula in an older installation, version support deserves attention first.
A practical troubleshooting checklist
Work from the broadest cause to the smallest. This avoids rewriting a complicated calculation when the actual problem is simply an older Excel release or one misspelled name.
- Confirm that the installed Excel version supports LET. On Windows, use File > Account > About Excel; on Mac, use Excel > About Microsoft Excel.
- Test LET in a blank cell with a simple example. With no worksheet cells required, this formula should return 11 in a supported version:
=LET(itemCount,10,itemCount+1)
- If the test works, inspect the larger formula. Match every declared name to each later use, and check for undefined workbook names.
- Verify that each name-value pair is complete and that the last argument is the intended calculation. Check parentheses and the list separator used by your regional settings.
- If the formula came from another workbook, confirm that it does not rely on a different function or a defined name that was not copied into your workbook.
- If the workbook must work in an older release, replace LET with an equivalent formula or provide a version that does not use unsupported functions.
For a complex formula in Windows Excel, Formulas > Evaluate Formula can step through parts of a calculation and help reveal where an unrecognized name enters the result. You can also temporarily shorten a copy of the formula to test its name-value pairs, but keep the original formula somewhere safe before editing.
When to keep LET and when to use another approach
Keep LET when the workbook’s users have supported Excel versions and named intermediate calculations make the formula easier to maintain. It is particularly helpful when the same expression appears several times in a formula. For instance, a long calculation can assign that repeated expression a name once and refer to it in the final result.
If users need to open the workbook in Excel 2019 or earlier, compatibility may matter more than formula compactness. A formula without LET can often produce the same result, though it may repeat calculations and be harder to read. You can also put intermediate calculations in helper cells, label those cells, and reference them from the final formula. This makes the logic visible on the sheet and can be easier to troubleshoot, at the cost of using more cells.
Do not confuse a LET name with a new worksheet function or a permanent named range. LET organizes one formula; it does not install a function, update Excel, or create a reusable name for other formulas. That distinction helps explain why a variable declared in one cell is not automatically available in a different cell.
Frequently Asked Questions
Why does Excel say LET is an unrecognized function?
Most often, the workbook is open in a release older than Excel 2021, or the installation needs an update. Check the Excel version and test a simple LET formula in a supported release.
Does LET work in Excel for Mac?
Yes. LET is supported in Microsoft 365 and Excel 2021 or later for Mac. Use Excel > About Microsoft Excel to check the version; menu names for updating can differ from Windows.
Can a misspelled LET variable return #NAME?
Yes. If the final calculation refers to a name that was not declared, or spells a declared name differently, Excel may return #NAME?. Compare each use with the name-value pairs at the start of the formula.
Do LET names work in other cells?
No. LET names are local to the formula in which they are declared. To reuse a name across formulas, create a defined name through Excel’s name tools or use a cell reference instead.
Will an older Excel version calculate a workbook that contains LET?
Not reliably. Versions without LET support may show #NAME? or an _xlfn. marker. If recipients use older software, provide a compatible formula or a separate compatible workbook.
Related
- Microsoft Excel Protect Sheet: Steps, Limits, and Tips
- Microsoft Excel Named Ranges: How They Work and Help
- Microsoft Excel CSV Import: Steps, Settings, and Fixes
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- Excel Filter Button Not Working? Fix Common CausesIf the Excel filter button is missing, greyed out, or not filtering the rows you expect, check that…
- Excel Column Is a Number Instead of a Letter? Fix ItIf Excel shows column headings as 1, 2, 3 instead of A, B, C, turn off R1C1 reference…
- Excel Scatter Plot: Connect Dots, Choose Lines, Fix IssuesYes. To connect points in an Excel scatter plot, choose a scatter chart type with lines: select Insert…
- Excel Hyperlink Not Working? How to Fix ItIf an Excel hyperlink is not working, first check how Excel expects you to open it: in Microsoft…
- Excel Find and Replace Not Working? Fix the Common CausesIf Excel Find and Replace is not working, first check the search scope and the options in the…
- VLOOKUP Not Working Even Though Values Match? FixesWhen VLOOKUP says values do not match, the cells often look identical but differ in data type, hidden…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.