Tabellab

LET: Name Your Intermediate Results for Readable, Faster Formulas

Lesson 1 of 20Lab

All lessons
  1. LET: Name Your Intermediate Results for Readable, Faster FormulasLabFree
  2. LAMBDA Basics: Parameters, a Calculation and Calling It InlineLab Locked
  3. Named LAMBDAs: TaxPrice, MarginPct and Your Own Workbook FunctionsLab Locked
  4. BYROW and BYCOL: One Formula for Every Row or ColumnLab Locked
  5. MAP: Your Own Logic for Every Element, Even with AND and ORLab Locked
  6. REDUCE and SCAN: Running Totals, Compounding and Final BalancesLab Locked
  7. MAKEARRAY: Multiplication Tables, Rotas and Payment SchedulesLab Locked
  8. Mid-course project: Refactor a Nested Commission Formula into LET and LAMBDALab Locked
  9. Debugging LET: Return Each Step, Find the Broken Name and Avoid Collapsing MAXLab Locked
  10. Robust LAMBDAs: Guard Against Blanks, Zeros and Text Like "n/a"Lab Locked
  11. A Named LAMBDA Library for Invoices: DueDate, DaysLate and AgeBucket Working TogetherLab Locked
  12. BYROW with Lookups and TAKE: Best Month, Quarter Growth and Row StatusLab Locked
  13. MAP for Text: Clean Supplier Codes, Split Them and Build Shop SKUsLab Locked
  14. SCAN Beyond Sums: Stock Balances, a Floor at Zero and Week-to-Date ResetsLab Locked
  15. REDUCE with a Rule Table: Replace Codes Step by Step and Chain DiscountsLab Locked
  16. LAMBDAs as Arguments: Pick the Summary Rule from a Cell and Reuse a Trimmed MeanLab Locked
  17. MAKEARRAY Sensitivity Grid: Profit for Every Price and Volume, with Bulk CostsLab Locked
  18. A Loan Schedule with SCAN, VSTACK and DROP: Balance, Interest and PrincipalLab Locked
  19. Category Summaries with MAP: Revenue, Margin and the Top Region per CategoryLab Locked
  20. Final Project: The Alder & Finch Year Dashboard Built with MAP, LET and Named LAMBDAsLab Locked

You are not signed in — the lab works, but your progress is not saved. Sign up

Lesson 1 of 20 is free. Unlock all 20 hands-on labs, the final exam and your certificate.

Buy course — $9.90
Loading the spreadsheet…

Why your longest Excel formula is probably repeating itself

If you have ever opened a workbook and found a formula that runs across the whole screen, you know the feeling. Somewhere in the middle there is a piece like B2*C2*(1-D2), and then the same piece again, and a little later once more. Nobody remembers why it was written that way, and nobody wants to touch it. This lesson is for analysts, finance and operations people, shop owners and anyone else who builds calculations that other people have to trust. You will learn the one function that fixes this problem at its root: LET.

We work with Alder & Finch, a fictional online furniture store. Every order has a quantity, a unit price and a discount. The net value of an order decides the shipping charge: from a net value of 1,500 shipping is free, below that it costs 4% of the net value but at least 35. The old shipping formula calculated the net value three times in a single cell. Every one of those repetitions is a place where a typo can hide, and Excel works out each repetition again on every recalculation. With LET you calculate the net value once, give it a name and reuse that name as often as you like.

By the end of this article you will understand how LET works, why it makes formulas both easier to read and cheaper to calculate, how to write and debug one step by step in Excel, and which mistakes trip up most people the first time. The interactive lab above uses exactly the same ten orders, so you can try every formula as you read.

What LET does, in plain words

LET lets you give a name to an intermediate result inside a single formula. Its syntax is =LET(name1, value1, [name2, value2, …], calculation). You write pairs: first a name, then the value or expression that name stands for. After the last pair comes one final argument, the calculation, and that is what the cell returns. A minimal example is =LET(gross,B2*C2,gross*(1-D2)): Excel calculates B2*C2, stores it under the name gross, and then returns gross*(1-D2).

Three properties make LET powerful. First, the names exist only inside that one formula. They do not appear in the Name Manager and they do not clash with names in other cells. Second, each value is calculated once, no matter how often you use its name afterwards. Microsoft describes this as one of the main reasons to use LET: a repeated expression no longer has to be evaluated again and again. Third, later names can use earlier names. That means you can build a calculation in small steps, exactly the way you would explain it to a colleague.

Order total for one Alder & Finch orderWithout LETB2*C2*(1-D2)net, calculated againB2*C2*(1-D2)net, calculated againB2*C2*(1-D2)net, calculated againTotalThe same net value is typed and calculated 3 times: 3 chances for a typo.With LETB2, C2, D2qty, price, discountnetcalculated onceshipIF / MAX on netnet+shipthe result=LET(net,B2*C2*(1-D2), ship,IF(net>=$B$14,0,MAX($B$16,net*$B$15)), net+ship)Each name is evaluated once and reused, so the formula reads top to bottom like a recipe.
Without LET the net value appears three times in one formula. With LET it is calculated once, named net, and reused by ship and by the final result.

Think of LET as a small recipe written into a single cell. The ingredients are cell references, every intermediate step gets a label, and the last line says what to serve. When you read =LET(net,B2*C2*(1-D2),ship,IF(net>=$B$14,0,MAX($B$16,net*$B$15)),net+ship) from left to right, it tells a story: the net value is quantity times price minus discount, shipping is zero above the limit and otherwise a percentage with a minimum, and the total is net plus shipping. The nested version without LET tells the same story, but you have to decode it.

LET is available in Excel for Microsoft 365, Excel 2021 and later, Excel for the web and the current Excel apps for Mac. If a colleague opens your file in Excel 2019 or older, LET formulas show the #NAME? error. Check which versions your audience uses before you roll LET out across a shared workbook.

Worked example: ten Alder & Finch orders

Here are the ten orders from the lab, with the three result columns already calculated. The rules sit in B14:B16 of the lab sheet: free shipping from 1,500 (B14), a shipping rate of 4% (B15) and a minimum shipping charge of 35 (B16). All names and numbers are fictional.

OrderQtyUnit priceDiscountNet (E)Shipping (F)Total (G)
AF-310124890%978.0039.121,017.12
AF-310211,59010%1,431.0057.241,488.24
AF-3103412910%464.4035.00499.40
AF-310412,15010%1,935.000.001,935.00
AF-31056890%534.0035.00569.00
AF-310627490%1,498.0059.921,557.92
AF-310733495%994.6539.791,034.44
AF-310811,6900%1,690.000.001,690.00
AF-310985915%401.2035.00436.20
AF-3110299510%1,791.000.001,791.00

Column E uses the simplest LET: =LET(gross,B2*C2,gross*(1-D2)). Order AF-3102 has one item at 1,590 with a 10% discount, so gross is 1,590 and the net value is 1,590 × 0.9 = 1,431. Column F names the net value and applies the shipping rule: =LET(net,B2*C2*(1-D2),IF(net>=$B$14,0,MAX($B$16,net*$B$15))). For AF-3102 that is 1,431 × 4% = 57.24, which is more than the minimum of 35, so shipping is 57.24. For AF-3103 the net value is 464.40, and 4% of it is only 18.58, so the minimum of 35 applies.

Column G puts both steps into one formula: =LET(net,B2*C2*(1-D2),ship,IF(net>=$B$14,0,MAX($B$16,net*$B$15)),net+ship). The name ship is defined using net, and the final calculation adds the two. AF-3104 has a net value of 1,935, above the limit, so its total is exactly 1,935.00. AF-3106 is the interesting one: two items at 749 with no discount give a net value of 1,498, just 2 below the limit, so the customer pays 59.92 in shipping. That is the kind of insight a clean formula helps you see, and a good conversation starter for a marketing team that wants to nudge customers over the limit.

Net value per order vs. the free-shipping limit (B14 = 1,500)06001,2001,8002,40097831011,431310246431031,935310453431051,498310699531071,690310840131091,7913110free from 1,500Order AF-… (mint = ships free, peach = just below the limit, sky = pays shipping)
Net value per order (column E) with the free-shipping limit from B14. Three orders ship free. AF-3106 misses the limit by just 2 and pays 59.92 in shipping.

Finally, cell B18 counts how many orders ship free, with one formula over the whole range: =LET(net,B2:B11*C2:C11*(1-D2:D11),SUM(--(net>=B14))). Here net is not a single number but an array of ten net values. The comparison net>=B14 returns ten TRUE/FALSE values, the double minus turns them into ones and zeros, and SUM adds them up. The answer is 3 (AF-3104, AF-3108 and AF-3110). If you had counted by gross value instead, AF-3102 would wrongly be included, because its gross value of 1,590 is above the limit but its net value of 1,431 is not.

Before and after: what LET changes

The table below puts the classic nested formula next to the LET version for the order total. Both return exactly the same numbers. The difference is how easy each one is to read, check and change.

Nested formula (no LET)LET formula
Formula in G2=B2*C2*(1-D2)+IF(B2*C2*(1-D2)>=$B$14,0,MAX($B$16,B2*C2*(1-D2)*$B$15))=LET(net,B2*C2*(1-D2),ship,IF(net>=$B$14,0,MAX($B$16,net*$B$15)),net+ship)
Times the net value is written31
Times the net value is calculatedup to 3 per cell1 per cell
What a reader seesa wall of cell referencesnamed steps: net, ship, result
Changing the discount logicedit three places, hope they matchedit one place

The nested version is not wrong, but it is fragile. Suppose the business decides that the discount should only apply to the first item. In the nested formula you have to change three copies of the same expression and make sure all three match. In the LET version you change the definition of net once, and both the shipping and the total follow automatically.

How to write a LET formula in Excel, step by step

  1. Click the first result cell, for example G2, and type =LET(. Excel shows the argument tooltip name1, name_value1, calculation_or_name2.
  2. Type the first name and a comma: net,. Choose short, descriptive names. They must start with a letter and must not look like a cell address.
  3. Type the value for that name: B2*C2*(1-D2),. Use relative references here so the formula still works when you copy it down.
  4. Add the next pair, which can use the first name: ship,IF(net>=$B$14,0,MAX($B$16,net*$B$15)),. Press F4 right after typing B14, B15 and B16 to lock them with dollar signs.
  5. Type the final calculation, close the bracket and press Enter: net+ship). The cell shows 1,017.12 for AF-3101.
  6. For readability, click into the formula bar and press Alt+Enter (Mac: Option+Return) before each name, so every step sits on its own line. Press Ctrl+Shift+U to expand the formula bar.
  7. Copy the formula down: double-click the fill handle (the small square at the bottom right of the cell) or select G2:G11 and press Ctrl+D.
  8. Check one row by hand, for example AF-3110: 2 × 995 × 0.9 = 1,791, above the limit, so the total must be 1,791.00.
To debug a LET, temporarily change the last argument to one of the names. =LET(net,B2*C2*(1-D2),ship,IF(…),net) shows you the net value, and swapping the last argument to ship shows the shipping. When each step looks right, put net+ship back.

Naming rules that save you from strange errors

  • A name must start with a letter and must not contain spaces. Use net_value or netValue, not net value.
  • A name must not look like a cell reference. tax1, AB2 and R1C1 are addresses, so Excel refuses them. taxRate is fine.
  • Names are not case-sensitive: Net and net are the same name inside one LET.
  • Every name needs a value, and the formula needs a final calculation. If you end with a name/value pair and no calculation, Excel reports an error.
  • Avoid names that are also function names, such as sum or max. Excel may accept some of them, but they confuse the reader.
  • Keep names short but meaningful. n is short but says nothing, netValueAfterDiscountBeforeShipping is precise but makes the formula long again. net is the sweet spot.

LET with whole ranges and dynamic arrays

LET is not limited to single values. A name can hold an entire array, as in the free-shipping count above. This is where LET really shines in modern Excel, because dynamic array formulas often need the same filtered or calculated array more than once. For example, =LET(net,B2:B11*C2:C11*(1-D2:D11),AVERAGE(FILTER(net,net<B14))) returns the average net value of the orders that still pay shipping, and =LET(net,B2:B11*C2:C11*(1-D2:D11),SUM(net)-SUM(B2:B11*C2:C11)) returns the total discount given, as a negative number. In both cases the array of net values is built once and reused.

This pattern becomes the backbone of the rest of the course. LAMBDA, BYROW, MAP, SCAN and REDUCE all work on arrays, and LET is how you keep those formulas readable. Once you are comfortable naming arrays, the jump to writing your own functions is much smaller than it looks.

Excel LET and LAMBDA course: readable formulas, custom functions and MAP, REDUCE and SCAN
The Excel LET & LAMBDA course takes you from naming steps with LET to building your own workbook functions.

Common mistakes and how to spot them

  • Forgetting the final calculation. =LET(net,B2*C2*(1-D2)) has a name and a value but nothing to return. Excel shows an error message as soon as you press Enter. Add the result as the last argument.
  • Using a name before it is defined. Names are read left to right, so ship can use net only if net comes first. If you see #NAME?, check the order of the pairs.
  • Missing dollar signs on the rules. Without $B$14 the copied formula in row 3 points to B15 as the limit. Spot it by clicking a lower row and checking whether the rule references still point to B14:B16.
  • Applying the discount in the wrong place. Testing B3*C3>=$B$14 uses the gross value, so AF-3102 would wrongly ship free. If an order with a discount ships free while its net value is below the limit, the test uses the wrong name.
  • Choosing a name that is a cell address. tax1 or vat20 look like addresses (column TAX, row 1). Excel rejects the formula. Rename to taxRate.
  • Sharing with older Excel versions. In Excel 2019 or older a LET formula shows #NAME?. If the same file shows correct values for you and errors for a colleague, check their version.
  • Multiplying by 100 when the cell is formatted as %. D2 already stores 0.1 for 10%, so 1-D2 is correct and 1-D2/100 would apply a 0.1% discount instead.

Quick reference: functions and shortcuts used

Function / keyWhat it doesExample from this lesson
LET(name1, value1, …, calculation)Names intermediate results inside one formula. The last argument is the result.=LET(gross,B2*C2,gross*(1-D2))
IF(test, if_true, if_false)Returns one of two values depending on a condition.IF(net>=$B$14,0,…)
MAX(a, b)Returns the larger value; used here as a minimum charge.MAX($B$16,net*$B$15)
SUM(--(condition))Turns TRUE/FALSE into 1/0 and adds them up: a count.SUM(--(net>=B14))
F4Cycles a reference through $B$14, B$14, $B14, B14.Lock the shipping rules before copying down.
Alt+Enter (Mac: Option+Return)Line break inside the formula bar, so each LET pair can sit on its own line.One line per name.
Ctrl+Shift+UExpands or collapses the formula bar (Windows).Read a long LET at once.
F9 (in the formula bar)Evaluates the selected part of a formula; press Esc to undo.Check what B2*C2*(1-D2) returns.

Real-world uses for LET

  • Pricing and quoting. A quote calculator that applies volume discounts, a minimum order fee and tax can name each step (gross, disc, fee, tax) so sales staff can follow the logic when a customer asks how a price was built.
  • Commission and bonus plans. Tiered commission formulas are notorious for deep nesting. With LET you name the sales amount, the attainment and the rate once, and the final payout reads like the plan document.
  • Finance and reporting. Variance formulas often need actual, budget and the difference several times, for example to show a percentage and a flag. LET calculates the difference once and returns a clean result.
  • Data cleaning. A formula that trims, cleans and splits a text value can name the cleaned text first and then extract parts of it, instead of repeating TRIM(CLEAN(A2)) four times.
  • Dashboards with dynamic arrays. A filtered list that feeds both a count and an average can be defined once with FILTER inside LET, which keeps large dashboards responsive.

What you will build in the rest of this course

Lesson 1 gives you the habit of naming steps. The remaining 19 labs turn that habit into your own toolbox of functions, all with Alder & Finch data and instant feedback on every formula.

LAMBDA Basics: Parameters, a Calculation and Calling It Inline. You write your first custom functions for the catalogue, such as converting inches to centimetres, footprint, volume and a shipping class, and call them directly in the cell, including from a LET variable. You will see that a LAMBDA is just a LET whose inputs are left open.

Named LAMBDAs: TaxPrice, MarginPct and Your Own Workbook Functions. You use custom functions like TaxPrice, MarginPct and Discounted exactly like built-in functions, nest them, and test a new Markup function inline before it gets a name. This is where colleagues start asking how you did it.

BYROW and BYCOL: One Formula for Every Row or Column. You summarise half a year of store sales with a single spilling formula per question: total and range per store, total per month and the number of stores that hit the target.

MAP: Your Own Logic for Every Element, Even with AND and OR. You set shelf prices, flag reorders with category-specific limits and pick homepage items with AND, then total the featured stock value with SUM(MAP()). You also learn why plain AND and OR do not work element by element, and how MAP fixes that.

REDUCE and SCAN: Running Totals, Compounding and Final Balances. You build year-to-date sales with SCAN, grow a cash reserve with monthly interest, get the year-end balance with REDUCE and chart the running total, without a single helper column.

MAKEARRAY: Multiplication Tables, Rotas and Payment Schedules. You generate three complete grids from nothing but a row and a column number: a crate by pack-size table, a weekly showroom rota and an instalment plan.

Mid-course project: Refactor a Nested Commission Formula into LET and LAMBDA. You take a real-looking, unreadable commission formula, rewrite it with LET, test a flat IFS version as an inline LAMBDA and total the whole plan with MAP and a named Commission function, proving at every step that the results stay identical. It is exactly the kind of clean-up you can then repeat in your own workbooks.

Summary

LET gives names to the steps of a calculation inside one formula. You write name/value pairs and finish with the calculation that the cell returns. Each value is calculated once, later names can use earlier ones, and the result is a formula that reads like a recipe instead of a puzzle. For Alder & Finch that means one definition of the net value that feeds the shipping charge, the order total and even a count over all ten orders.

The best way to make it stick is to type it yourself. Scroll up to the lab, fill E2:E11 with the gross formula, build the shipping and total columns with net and ship, and let the Coach check your count in B18. It takes about a quarter of an hour, and you will never look at a long nested formula the same way again.

Frequently asked questions

What does the LET function do in Excel?

LET assigns names to intermediate results inside a single formula. You write name and value pairs, and the last argument is the calculation the cell returns, for example =LET(gross,B2*C2,gross*(1-D2)).

Does LET make Excel formulas faster?

It can. Each named value is calculated only once, even if the name is used several times, so a formula that used to repeat an expensive expression does less work.

Which Excel versions support LET?

LET works in Excel for Microsoft 365, Excel 2021 and later, Excel for the web and current Excel for Mac. Older versions such as Excel 2019 show a #NAME? error.

What names can I use inside LET?

A name must start with a letter, contain no spaces and must not look like a cell reference, so tax1 or AB2 are not allowed. Short descriptive names such as net, ship or taxRate work well.

Can a LET variable hold a whole range or array?

Yes. A name can hold an array such as B2:B11*C2:C11, and you can then filter, count or sum it, for example =LET(net,B2:B11*C2:C11,SUM(--(net>=1500))).

What is the difference between LET and LAMBDA?

LET names values that are fixed inside one formula. LAMBDA creates a reusable function with parameters that you can call with different inputs or save under a name in the Name Manager.

Keep going: Excel LET & LAMBDA: Readable Formulas, Custom Functions & MAP/REDUCE

This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time $9.90.

  1. LAMBDA Basics: Parameters, a Calculation and Calling It Inline
  2. Named LAMBDAs: TaxPrice, MarginPct and Your Own Workbook Functions
  3. BYROW and BYCOL: One Formula for Every Row or Column
  4. MAP: Your Own Logic for Every Element, Even with AND and OR
  5. REDUCE and SCAN: Running Totals, Compounding and Final Balances
  6. MAKEARRAY: Multiplication Tables, Rotas and Payment Schedules
  7. Mid-course project: Refactor a Nested Commission Formula into LET and LAMBDA
  8. Debugging LET: Return Each Step, Find the Broken Name and Avoid Collapsing MAX
  9. Robust LAMBDAs: Guard Against Blanks, Zeros and Text Like "n/a"
  10. A Named LAMBDA Library for Invoices: DueDate, DaysLate and AgeBucket Working Together
  11. BYROW with Lookups and TAKE: Best Month, Quarter Growth and Row Status
  12. MAP for Text: Clean Supplier Codes, Split Them and Build Shop SKUs
  13. SCAN Beyond Sums: Stock Balances, a Floor at Zero and Week-to-Date Resets
  14. REDUCE with a Rule Table: Replace Codes Step by Step and Chain Discounts
  15. LAMBDAs as Arguments: Pick the Summary Rule from a Cell and Reuse a Trimmed Mean
  16. MAKEARRAY Sensitivity Grid: Profit for Every Price and Volume, with Bulk Costs
  17. A Loan Schedule with SCAN, VSTACK and DROP: Balance, Interest and Principal
  18. Category Summaries with MAP: Revenue, Margin and the Top Region per Category
  19. Final Project: The Alder & Finch Year Dashboard Built with MAP, LET and Named LAMBDAs

Buy course — $9.90 See the full course