Even if you've never written one yourself, you've probably seen a formula that stretches so far across Excel's formula bar that you don't even bother trying to make sense of it. It might contain three nested XLOOKUPs, an IF statement, or several other essential Excel functions working together, but with so many moving parts, it's easy to lose track of what the formula is actually supposed to achieve.
I've found LET to be the best fix for this. It's an Excel function borrowed from programming that makes complex formulas significantly easier to read, write, and maintain, and it hasn't failed me yet.
The Excel functions I use most (and why they’re so useful)
I use these four excel functions every time I have to handle messy spreadsheets.
How LET simplifies my Excel formulas
Clearer logic, fewer repeated calculations, and better performance
The basic idea behind LET is simple. Instead of cramming every calculation into one giant nested formula, you assign names to different parts of the formula, much like you would define variables in a programming language. The syntax looks like this:
=LET(name1, name_value1, [name2, name_value2], ..., final_calculation)
You define a name, assign it a value, and then move on to the next name-value pair. You can define up to 126 names within a single formula, and the final argument is always the calculation that brings everything together. Each new name can even build on one you defined earlier, allowing you to daisy-chain a sequence of transformations without losing track of what's happening.
LET also improves efficiency. In a normal formula, if you reference the same lookup or calculation multiple times, Excel recalculates it from scratch every time it appears. With LET, that calculation runs once, gets stored under its assigned name, and is reused wherever it's needed without being recalculated.
Ways you can put LET to work in your spreadsheet
From lookups to dynamic arrays, here are some of the most useful applications
The idea of using LET to simplify your formulas can sound a little abstract until you see it in practice. Here are a few ways I use LET that might inspire you.
Say you're calculating order revenue by pulling Unit Price and Units Sold from a master inventory table based on an Order ID in cell G2:
=XLOOKUP(G2, ProductCatalog[ID], ProductCatalog[Price]) * XLOOKUP(A2, ProductCatalog[ID], ProductCatalog[Qty])
That's two full searches across your dataset, and if you ever need to replace G2 with H2 or another cell reference in Excel, you have to update it in multiple places. Wrapping the formula in LET makes it much easier to manage:
=LET(TargetID, G2:G100,
Price, XLOOKUP(TargetID, ProductCatalog[ID], ProductCatalog[Price]),
Qty, XLOOKUP(TargetID, ProductCatalog[ID], ProductCatalog[Qty]),
Price*Qty)
Now the final calculation simply reads Price × Qty, and if anything changes, you only have one place to update.
Next, imagine a shipping tax formula that adds Total Cost and Total Profit, divides the sum by a regional modifier, rounds up, and returns either "Standard Rate" or the calculated amount, depending on the outcome. Written the obvious way, Excel performs the same rounding calculation twice, which isn't ideal on a worksheet with 50,000 rows:
=IF(ROUNDUP((M2+N2)/P2, 0)<100,"Standard Rate",
ROUNDUP((M2+N2)/P2, 0))
LET calculates the result once and reuses it:
=LET(TaxCalc, ROUNDUP((M2+N2)/P2, 0),
IF(TaxCalc<100, "Standard Rate", TaxCalc))
LET also pairs well with functions like CHOOSECOLS and FILTER. Imagine an analyst enters a country into cell P2, and you want Excel to return only the matching rows while displaying just three specific columns:
=LET(MatchedRows, FILTER(A2:N101, B2:B101 = P2),
CHOOSECOLS(MatchedRows, 5, 9, 14))
Here, MatchedRows acts as a temporary array containing only the rows for the selected country. CHOOSECOLS then pulls columns 5, 9, and 14 from that intermediate result. The advantage is that the entire transformation happens within a single formula, without cluttering your worksheet with intermediate calculations.
Finally, you can use LET to freeze volatile functions. This benefit is easy to overlook if you've never encountered the issue before. RAND() generates a new value every time it's called, even when it appears multiple times within the same formula. That means a formula like this can produce inconsistent results:
=IF(RAND() > 0.5, RAND() * 2, 0)
The first RAND() might generate 0.7 and pass the test, while the second RAND() generates a completely different value. Meanwhile, LET locks the value down:
=LET(
StaticRoll, RAND(),
IF(StaticRoll > 0.5, StaticRoll * 2, 0))
One random value is now used consistently throughout the formula.
Before you start naming everything
There are a few things worth keeping in mind before you go wild with LET in your Excel formulas. Give your variables names that actually describe what they represent, such as TotalSales instead of x, so that anyone, including your future self, can glance at the formula and understand what's happening. Names must start with a letter, and a few single-letter names, such as c and r, are off-limits because Excel interprets them as R1C1 cell references. Descriptive names are helpful, but don't overdo them, as long names become unwieldy in a chain of nested calculations.
It's also worth remembering that LET isn't always the right tool. For something as simple as =SUM(A:A), it's unnecessary because it adds complexity without providing any real benefit. You should also consider who will be using the workbook. If you're sharing it with coworkers or auditors who aren't familiar with modern Excel functions, a LET-heavy workbook may actually make their job harder rather than easier.
The simplest way to tame monster formulas
The LET function transforms Excel from a basic grid into something that feels much more like a programming environment. Allowing you to assign names to intermediate calculations makes formulas easier to read while reducing unnecessary recalculations.
Whether you're shortening a repetitive XLOOKUP or building complex dynamic arrays, give LET a try. You might find that a formula you once dreaded becomes something you can understand at a glance.
- OS
- Windows, macOS
- Supported Desktop Browsers
- All via web app
- Developer(s)
- Microsoft
- Free trial
- One month
- Price model
- Subscription
- iOS compatible
- Yes
Microsoft Excel is a powerful spreadsheet application used for data organization, analysis, and visualization. It supports formulas, functions, pivot tables, and charts to process complex datasets efficiently. Widely used in business and education, Excel also integrates with other Microsoft 365 apps for collaboration, automation, and real-time data insights.