LET

Short answer

Name the pieces of a long formula

LET(name1, name_value1, [name2, name_value2], ..., calculation)
Excel version
2021+
Also searched as
named variables in formula, excel formula variables, formula readability, calculate once use many times, let lambda

What it returns

LET returns the result of its last argument, the calculation. Every argument before it comes in pairs: a name, then the value that name stands for. Inside the formula you use the name instead of retyping the expression.

Two things follow from that. The formula reads like a set of labeled steps, so the next person can audit it. And each named value is calculated once per evaluation, however many times the calculation refers to it. A SUMIFS that used to appear three times in one cell now runs once.

Names exist only inside that one formula. They do not show up in Name Manager and cannot be referenced from another cell. A name can use any name defined before it, which is how you build a calculation up step by step.

Arguments that matter

ArgumentRequiredWhat it does
name1YesThe first name. Must start with a letter and must not look like a cell reference.
name_value1YesThe value or expression the name stands for. A cell, a range, a SUMIFS, a whole spilled array.
further pairsNoUp to 126 name and value pairs in total. Each can use the names above it.
calculationYesThe last argument. The result LET returns, written in terms of the names.

The argument count is always odd: pairs, then one calculation. If the count is even, Excel reads your final name as a name with no calculation after it and refuses the formula.

Put each pair on its own line with Alt+Enter and widen the formula bar. That layout is most of the readability benefit. A LET written on one line is barely easier to read than the nested formula it replaced.

In a financial model

LET earns its place in the long cells: the cash sweep, the covenant test, the interest line that pulls a rate, a day count and an opening balance. Those are the formulas reviewers skip because they cannot parse them, and the ones most likely to hold an error.

The play on LET instead of repeating a fragment sets the rule. When an expression appears more than once inside a formula, bind it to a name. Repetition costs calculation time, and it costs correctness: change the fragment in one place and forget the other, and the cell is now wrong in a way nothing flags.

The speed win matters most where a model is slow. A grid of several hundred cells, each repeating a SUMIFS across a large ledger extract, evaluates every copy. Bind it once and each cell does a third of the work.

LET is also where named inputs get their local labels. MinCash and Sweep live on the inputs tab as defined names, per no constants inside formulas. LET handles the intermediate results that do not deserve a cell of their own.

Worked example

A term loan schedule on tab Debt, months across row 8 from column F. Row 30 holds the opening balance. Rows 50 to 70 hold the cash flow waterfall, with labels in column C, one of which is CFADS. Two defined names on the inputs tab: MinCash, the cash floor, and Sweep, the share of excess cash that goes to repayment.

The sweep repayment in row 32:

=LET(
  cfads,     SUMIFS(F$50:F$70, $C$50:$C$70, "CFADS"),
  available, MAX(cfads - MinCash, 0),
  opening,   F30,
  MIN(available * Sweep, opening)
)

Read top to bottom: find cash available for debt service, take out the floor, cap the sweep at what is still owed. Filled right, it returns one repayment per month.

MonthCFADSMinCashSweepOpeningRepayment
Jan-261,40050050%2,000450
Feb-2630050050%1,5500
Mar-264,20050050%1,5501,550

February has less cash than the floor, so available is zero. March would sweep 1,850, so the opening balance caps it.

Old way vs new way

The same logic without LET, with the SUMIFS written twice:

=IF(SUMIFS(F$50:F$70,$C$50:$C$70,"CFADS")-MinCash>0, MIN((SUMIFS(F$50:F$70,$C$50:$C$70,"CFADS")-MinCash)*Sweep, F30), 0)

With LET:

=LET(cfads, SUMIFS(F$50:F$70, $C$50:$C$70, "CFADS"), available, MAX(cfads - MinCash, 0), MIN(available * Sweep, F30))

The SUMIFS runs once instead of twice, and a change to the waterfall range happens in one place. The other route was a helper row for cash available. That works, but it adds rows to the schedule for values nobody reports.

Where it breaks

Excel refuses the formula when you press Enter. A name looks like a cell reference. fy24, rev1 and tax2 are all valid addresses, because columns run to XFD. Fix: use names that cannot be addresses, such as fy_2024, rev_base or tax_q2.

LET returns #NAME?. Either a name is used before the pair that defines it, or a name is misspelled in the calculation. Names resolve top to bottom. Fix: check the spelling against the definitions and move the pair above the first line that uses it.

The result is wrong and you cannot see which step. A long LET hides its intermediate values. Fix: temporarily replace the final calculation with one of the names, such as available. The cell now shows that intermediate value. Check each step in turn, then restore the calculation.

The file shows #NAME? on a colleague’s machine. LET needs Excel 2021 or Microsoft 365. Excel 2019 and earlier do not recognize it. Fix: if the model has to open in older versions, move the named steps into helper rows.

The LET needs scrolling to read. Ten pairs in one cell is a calculation block hiding in a formula bar. Reviewers cannot trace it with arrows, and it breaks the spirit of three levels of nesting is the limit. Fix: keep LET for removing repetition. Steps someone needs to review belong in rows.

A hard-coded rate hides inside a pair. rate, 0.065 reads cleanly, which makes it easy to miss in review. The number is now an input with no color, no source and no owner. Fix: point the pair at a defined name on the inputs tab.

Related functions

  • LAMBDA. LET names values inside one formula. LAMBDA turns the whole formula into a function you can call from any cell. Build the logic as a LET first, then wrap it.
  • SUMIFS. The fragment you will bind most often. Name the SUMIFS result once, then test it, cap it and scale it.
  • XLOOKUP. The other usual suspect. A rate pulled from a mapping table and used three times belongs in a LET pair.
  • FILTER. Bind a filtered array to a name, then count it, sum it and test it for empties without filtering three times.
  • Read the play LET instead of repeating a fragment for the rule and its exception.

All functions