Readable formulas with LET
Name intermediate calculations so the business rule is easier to read and review.
By the end, you’ll be able to:
- Read the name/value/calculation structure of LET
- Reuse a calculated result without repeating its expression
- Choose meaningful local names and test boundary cases
Make repeated logic visible
Stock cover is stock divided by weekly demand. You want a label Review when cover is below three weeks, otherwise Enough. Repeating the ratio in a long formula makes it harder to inspect or change consistently.
=LET(cover,B2/C2,IF(cover<3,"Review","Enough")) gives the ratio a local name. For stock 120 and demand 30, cover is 4 and the result is Enough. The name describes what the number means rather than where its inputs happen to be.
| A | B | C | |
|---|---|---|---|
| 1 | SKU | Stock | Weekly demand |
| 2 | P101 | 120 | 30 |
| 3 | P102 | 40 | 20 |
| 4 | P103 | 0 | 10 |
Define names, then return a calculation
=LET(name1, name_value1, [name2, name_value2], ..., calculation)name1 is a valid local name. name_value1 is its value or expression. Add optional name/value pairs, then finish with the calculation whose result you want. Each name can be used by subsequent definitions and the final calculation.
Names exist inside that LET formula. They do not create worksheet cells or workbook-wide names. Avoid names that look like cell addresses, such as Q1, and reserved reference names such as R or C. Use names such as demand, cost and cover.
Worked example: net sales after a discount
Gross sales is B2, discount rate is C2 and fixed processing cost is D2. Write =LET(net,B2*(1-C2),net-D2). For 1,000 gross, 10% discount and 25 cost, net is 900 and the final result is 875.
For a margin ratio, define more than one value: =LET(net,B2*(1-C2),profit,net-D2,IF(net=0,"No sales",profit/net)). Here D2 represents the full relevant cost, not merely the processing cost from the previous example. State the input definition whenever you reuse a formula pattern.
The order matters. Define net before using it to calculate profit. The final argument must return the intended output rather than introduce another unfinished name.
Handle zero demand before division
If weekly demand is zero, stock cover is not a meaningful finite ratio. Put the guard outside the calculation: =IF(C2=0,"No demand",LET(cover,B2/C2,IF(cover<3,"Review","Enough"))).
For zero stock and demand 10, cover is 0 and Review is appropriate. For stock 80 and demand 0, the label No demand calls for a different review. Replacing both cases with 0 would erase a useful distinction.
A LET formula is still a model. Incorrect units, a negative demand value or a stale stock balance can produce a readable but misleading result. Validate the inputs and document the threshold.
Use names to support review
Excel versions: Dynamic arrays, FILTER, SORT, UNIQUE, XLOOKUP and LET are available in Microsoft 365, Excel 2021 and Excel 2024, including supported Mac versions. LAMBDA requires Microsoft 365 or Excel 2024. The browser exercises work without installing Excel; they implement the lesson's stated subset rather than the complete Excel calculation engine.
Give a reviewer a short description of the measure and its units. Compare a few results with independent hand calculations. Change the inputs and test below, at and above each threshold.
LET can avoid repeating an expression, but do not claim a universal speed improvement for every workbook. Its first benefit in these examples is clarity. If a formula becomes more complicated with extra names, use fewer names or move important intermediate outputs into visible cells.
Give it a try.
Work through each exercise, check your answer and use a hint whenever you need one. Formula tasks check changed inputs, including boundary cases.
0 of 4 exercises complete
The bounded practice checker accepts equivalent supported formulas, lowercase function names and text labels, extra spaces, and comma or semicolon separators. Array tasks check the complete result shape and values. It is a teaching tool, not a complete Excel engine. See supported behavior.
Take this with you
LET assigns local names to intermediate results. Use those names to clarify a rule, and keep explicit guards for undefined measures.
Practice in Excel
Download the course workbook, follow the tasks, save your completed .xlsx and check its supported formula tasks here. Native Excel features use a separate review checklist.
Download practice workbook Check my workbook ↗Technical references and lesson review
Original lesson content. Technical behavior checked against Microsoft documentation. Reviewed 2026-10-16.