Trending

World technology news

→
Building an auditable weighted delivery rate with LET in Excel 2021
Business Intelligence · 2021
Business Intelligence2021

Building an auditable weighted delivery rate with LET in Excel 2021

An Excel 2021 LET formula names the eligible rows, late pallets, and denominator for a delivery report. A six-row worksheet gives exact expected results for different hubs and time limits.

Archive retrospective · Topic year 2021

Developer's JournalPublished: Nov 27, 20266 min read
Reading progress0%
In this article
  1. Define the measure before building the formula
  2. Check the six input rows by hand
  3. Name the eligibility rule once
  4. Distinguish a zero result from missing eligible data
  5. Record exact outputs before the next revision
  6. Choose how to share the finished calculation

Define the measure before building the formula

A logistics team wants a weekly view of pallets that arrived after a delivery target. One row represents a shipment, and shipments carry different pallet counts. A rate based on shipments answers one question. A rate weighted by pallet count answers another. This example gives each pallet equal weight. The denominator counts pallets in completed shipments at the selected hub. The numerator counts those eligible pallets when their shipment ran beyond the selected time limit. A shipment exactly on the limit is on time. Microsoft documents LET as a feature of Excel 2021 for Windows. It is also available in Microsoft 365. The historical point here is its availability in Excel 2021 and how a small reporting design can make use of it. Write down the numerator and denominator before opening the worksheet. An explicit definition makes it easier to explain a later change in the displayed result.

Check the six input rows by hand

Fill cells A1 through D7 using the sample below. Column A is the hub, B is the shipment status, C is the number of pallets, and D is elapsed delivery time in hours. Set F2 to North and F3 to 18. Use F4 for the calculation. The values are fictional and small enough to inspect without a tool. North has three delivered shipments carrying 10, 30, and 20 pallets. They give a denominator of 60. The 30 pallets that arrived after 24 hours are late. The shipment at 18 hours meets the threshold. A cancelled shipment with 12 pallets and 50 hours stays out of both parts of the calculation. The resulting rate is 30 divided by 60, or 50 percent. Counting shipments instead would yield one late shipment out of three qualifying shipments. The example gives the report owner a concrete way to choose the metric the business needs.

Data processing architectureConceptual sketch · summary of the article's technical flow
A1:D7
Hub    Shipment status  Pallets  Hours
North  Delivered        10       14
North  Delivered        30       24
South  Delivered         8       28
North  Cancelled        12       50
North  Delivered        20       18
South  Delivered        12       12

F2 = North
F3 = 18
F4 = weighted late rate formula
Expected F4 result: 50%

Name the eligibility rule once

LET accepts pairs of names and values followed by an expression that returns the result. Here hub, shipmentStatus, palletQty, and elapsedHours refer to the four input ranges. The eligible array multiplies two conditions and yields one where both match. The numerator and denominator each use that same array. Editing the condition in one place helps prevent drift between the calculations. The formula uses English function names and comma separators. Use the separators and function names appropriate to your Excel settings. Format F4 as a percentage. The threshold in F3 should be a validated number of hours. Use equally sized ranges for SUMPRODUCT. For a growing workbook, all four inputs can come from the same Excel table, whose structured columns extend together when a row is added. Small fixed ranges make this particular example easier to audit.

=LET(
  hub, $A$2:$A$7,
  shipmentStatus, $B$2:$B$7,
  palletQty, $C$2:$C$7,
  elapsedHours, $D$2:$D$7,
  eligible, (hub=$F$2)*(shipmentStatus="Delivered"),
  eligiblePallets, SUMPRODUCT(eligible,palletQty),
  latePallets, SUMPRODUCT(eligible,--(elapsedHours>$F$3),palletQty),
  IF(eligiblePallets=0,NA(),latePallets/eligiblePallets)
)

Distinguish a zero result from missing eligible data

A selected hub can have no qualifying deliveries. A zero denominator returns NA() here so the report can distinguish missing eligible data from a genuine zero late rate. An interface can show a separate status message if its presentation needs plain language. A chart or export can then apply a documented policy to that status. Keep input validation visible too. A number pasted as text can produce an unexpected total, and SUMPRODUCT treats non-numeric entries as zero in its array arguments. Missing elapsed time needs its own handling rule. Validate pallet counts, delivery hours, and shipment status in the input layer or use an adjacent check column. The report should let a reviewer see when an input issue changed the set of included rows. That is a different task from deciding how the formula computes its rate.

Record exact outputs before the next revision

With South and the same 18-hour target, the example gives 8 late pallets out of 20, or 40 percent. North with a 24-hour target gives zero percent because a shipment finishing at the target is on time. An unknown hub gives #N/A. North with a target of 14 hours gives 50 late pallets out of 60, about 83.33 percent. Return F2 and F3 to North and 18 and the rate is again 50 percent. To inspect an intermediate value, temporarily return eligiblePallets as the final LET argument in a review copy. Confirm that it is 60 for the first test. Return latePallets next and confirm that it is 30, then restore the calculation. A future policy could classify shipments ending exactly at the target as late. If that happens, update the comparison, the expected results, and the report definition together.

Choose how to share the finished calculation

LET names are scoped to their formula. If several cells need the same intermediate figure, expose that figure in a cell or design a shared calculation with a clear contract. Reusing a named expression can reduce repeated evaluation within one cell. Measure performance using the real workbook if speed is part of the decision. For the sample, the main benefit is keeping the business condition and its calculations close together. Check which Excel versions will open the shared file. For a recipient who only needs verified results, exporting values is a separate delivery choice. Document the vocabulary for shipment status, the unit for elapsed time, and the zero-denominator policy beside the workbook. Those notes let someone verify that a later edit changed what the business asked for and left the other assumptions intact.

Be the first reader ✎ Write a comment

Reader discussion

Discussion prompt

What is the most important unanswered question about this topic?

No comments yet. Be the first to contribute.

Write a comment

Comments are real visitor contributions. Repeated, link-heavy or abusive submissions may be limited.