Excel9 min read

The LET Function: How to Write Excel Formulas That Anyone (Including Future You) Can Read

Excel's LET function lets you name intermediate values inside a formula. The result is shorter, faster, and far easier to debug. Here is the syntax, four practical patterns, and the cases where LET is worth the rewrite versus where it isn't.

The LET Function: How to Write Excel Formulas That Anyone (Including Future You) Can Read

The standard objection to long Excel formulas is not that they are hard to write. It is that they are hard to read three months later when something breaks and you have to figure out what the original author was thinking.

The LET function, generally available since 2021 in Excel for Microsoft 365 and Excel 2021 onward, fixes the readability problem in a way nothing else in the formula bar can. It lets you name intermediate values inside a single formula and then refer to those names. The same calculation, written without LET, ends up duplicating expressions and forcing the reader to mentally re-evaluate the same thing several times. With LET, you write each piece once, name it, and use the name.

This article walks through the actual syntax, four patterns where LET earns its keep, the performance benefit that is easy to miss, and a candid view of where LET is overkill.

The Syntax in One Sentence

LET takes pairs of names and values, followed by a final calculation that uses those names.

=LET(name1, value1, name2, value2, ..., calculation)

The pairs can be as many as you like, and a name defined earlier can be used in a later value. Names are local to the formula. They do not exist anywhere else in the workbook and they disappear when the formula finishes evaluating. There is no risk of polluting a global namespace because there is no namespace.

A trivial example to anchor the syntax:

=LET(price, A1, tax, 0.07, price * (1 + tax))

Here, price is bound to whatever is in A1, tax is bound to 0.07, and the final calculation multiplies them. Read aloud, this is the same as: "Let price equal A1 and tax equal seven percent. The answer is price times one plus tax." Excel formulas almost never read like that. With LET, they can.

Pattern One: Eliminating Duplicated Subexpressions

The single most common reason a formula is hard to read is that it contains the same expression twice or three times. IF formulas are the worst offenders.

Without LET:

=IF(SUMIFS(C:C, A:A, "North", B:B, ">0") > 10000, SUMIFS(C:C, A:A, "North", B:B, ">0") * 0.1, SUMIFS(C:C, A:A, "North", B:B, ">0") * 0.05)

The same SUMIFS is written three times. To understand the formula you have to recognise that all three are identical, then mentally factor them out, then read what is left. Worse, if you ever need to change the SUMIFS criteria, you must change them in three places.

With LET:

=LET(s, SUMIFS(C:C, A:A, "North", B:B, ">0"), IF(s > 10000, s * 0.1, s * 0.05))

The SUMIFS is written once, named s, and used three times by name. The formula is shorter, easier to read, and only has one place to edit.

There is also a performance difference, which is usually understated. Excel evaluates a named expression in LET once. Without LET, an expression that appears three times is evaluated three times, even if the result is identical. On large workbooks with thousands of LET candidates, that compounds.

Pattern Two: Building a Calculation in Named Steps

A complex formula often computes several intermediate values on the way to the final answer. Naming each step makes the structure visible.

Imagine a formula that calculates the effective hourly rate of a salaried employee, accounting for benefits and paid time off.

=LET( annual_salary, B2, benefits_value, B3, total_compensation, annual_salary + benefits_value, weeks_per_year, 52, weeks_pto, B4, weeks_worked, weeks_per_year - weeks_pto, hours_per_week, B5, total_hours, weeks_worked * hours_per_week, total_compensation / total_hours )

Even without context, this formula reads as a small program. Each line names a value or a step. The final line is the calculation. Anyone reading this six months from now can verify the logic without reverse-engineering it.

The unrolled version, with everything inlined, would be a single line of nested arithmetic that no one wants to debug.

Pattern Three: Making Conditional Logic Auditable

When IF is nested several levels deep, the formula becomes a thicket of commas. LET turns nested IF chains into something you can talk through.

=LET( amount, A2, tier1, 1000, tier2, 5000, tier3, 10000, rate1, 0.05, rate2, 0.07, rate3, 0.10, rate4, 0.12, rate, IF(amount < tier1, rate1, IF(amount < tier2, rate2, IF(amount < tier3, rate3, rate4))), amount * rate )

The thresholds and rates are explicit at the top. The logic uses those names. The final calculation is one line. If you ever need to adjust a threshold, you change one number, not a buried literal inside a long IF.

Pattern Four: Making Array Formulas Tractable

Dynamic array formulas, with FILTER, SORT, UNIQUE, and friends, often build up an intermediate array that gets used in two places. Without LET, you compute it twice.

For example, finding the top three rows in a filtered subset:

=LET( filtered, FILTER(A2:C100, A2:A100 = "Active"), sorted, SORT(filtered, 3, -1), TAKE(sorted, 3) )

Each step is named and built on the previous one. If you needed to change the filter criterion or the sort order, exactly one line changes.

What LET Is Not For

LET pays off when a formula is long, repeated, or hard to read. It does not pay off everywhere.

A one-line arithmetic formula like =A1 + B1 does not need LET. The cognitive overhead of the name pairs would dwarf the formula itself.

A pure lookup like =VLOOKUP(A2, Reference!A:C, 3, FALSE) does not need LET unless the same lookup is repeated in the formula or the result is reused.

A formula whose meaning is obvious from its operators does not need LET to clarify intent. Save the function for the cases where the formula is no longer self-explanatory.

A reasonable rule: if you would not annotate the formula with a comment if cell formulas could have comments, LET is probably unnecessary. If you would annotate it, LET is almost always the right way to write the comment, because the names are the comments.

LET, LAMBDA, and the Path to Reusable Excel

LET is one half of a pair. LAMBDA, generally available since 2021 alongside LET, lets you wrap a calculation as a reusable function with named parameters. The two are designed to work together.

A typical pattern: write the calculation once with LET, get it working, then promote it to a LAMBDA defined in the Name Manager so other cells can call it like a built-in function. The LAMBDA's body often uses LET internally to keep itself readable.

This is how Microsoft has been quietly turning Excel into a programmable spreadsheet without changing the formula bar. The combination of LET, LAMBDA, dynamic arrays, and the newer functions in the lambda helper family means that a competent analyst can now build, in pure formulas, what previously required VBA or Power Query.

A Brief Note on Performance

LET's performance benefit comes from the fact that named expressions are evaluated once per LET call, regardless of how many times the name is referenced. For most small formulas this is invisible. For large workbooks where the same expensive subexpression appears five or ten times across many cells, switching to LET can produce a measurable recalculation speedup.

This is not a reason to wrap everything in LET. It is a reason to pay attention when you find yourself writing the same SUMIFS, INDEX/MATCH, or large array calculation more than once in a single formula.

Where LET Earns Its Keep, Summarised

The function is worth it whenever a formula has any of these characteristics. Repeated subexpressions are the strongest case. Multiple steps of logic that build on each other is the second strongest. Long IF chains where the thresholds and outcomes deserve names is the third. Array formulas where an intermediate result is reused is the fourth.

For everything else, leaving the formula alone is usually fine. LET is a tool for the formulas that have grown beyond what a single line can communicate clearly. Used in those cases, it changes Excel from a stack of opaque expressions into something a future reader can actually understand.

For a deeper look at writing reliable spreadsheet logic, our ultimate Excel formulas reference guide covers the function families that LET most often improves. And for the LAMBDA side of the story, the same concepts extend into building your own reusable functions on top of the patterns shown above.

Found this helpful?

Follow us on LinkedIn for daily productivity tips.

Follow on LinkedIn