Advanced / Lesson 05

Readable formulas with LET

Name intermediate calculations so the business rule is easier to read and review.

~30 minutes4 exercisesSee lesson notes for version and platform support

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.

Example worksheet with column letters and row numbers
ABC
1SKUStockWeekly demand
2P10112030
3P1024020
4P103010

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.

Now make it yours

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

Exercise 01 / Formula practice

Name stock cover

Use LET to name stock cover from B2/C2 as cover, then return cover. Enter E2.

Example worksheet with column letters and row numbers
ABC
1SKUStockWeekly demand
2P10112030
3P1024020
4P103010
Exercise 02 / Formula practice

Name net revenue

B2 is gross sales, C2 is discount rate and D2 is fixed cost. Use LET to calculate net=B2*(1-C2), then return net-D2 in F2.

Example worksheet with column letters and row numbers
ABCD
1PeriodGross salesDiscountFixed cost
2Apr10000.125
Exercise 03 / Formula practice

Guard and label cover

If C2 is zero, return No demand. Otherwise use LET to name cover=B2/C2 and return Review below 3 weeks, or Enough at 3 or more. Enter E2.

Example worksheet with column letters and row numbers
ABC
1SKUStockWeekly demand
2P10112030
3P1024020
4P103010
Exercise 04 / Knowledge check

Choose a safe local name

Which is an appropriate local LET name for inventory divided by weekly demand?

Choose one answer

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.

Find your next skill