Perform logical operations by using the LET() function
=LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7), COUNTIFS(B2:B7, "Overdue", C2:C7, ">"&avg))Name the average overdue balance avg, then count the overdue rows above it. LET takes a name, its value, and finally the calculation that uses the name.
What the MO-211 task asks
LET is one of the few functions a task names outright, because the point is how the formula is built: “count the Overdue berths whose Balance Due is above the average Balance Due of all Overdue berths. Use LET to name that average once and reuse it in the count.”
So a LET task is checked twice in our grader: the value in the cell, and that the formula uses LET. The shape is always name, value, then the calculation — and the name is used inside the calculation where the value would otherwise be typed again.
LET is not on MO-210; it is an MO-211 function. The outline lists it with the logical functions because it usually wraps them.
Worked examples
Type these into a blank sheet to follow along. Every result below is what Excel showed.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Berth | Status | Balance | Above avg | |
| 2 | B-1 | Overdue | 900 | 2 | |
| 3 | B-2 | Paid | 150 | ||
| 4 | B-3 | Overdue | 300 | ||
| 5 | B-4 | Overdue | 1200 | ||
| 6 | B-5 | Paid | 400 | ||
| 7 | B-6 | Overdue | 600 |
=LET(x, 5, x*2)Name x, give it the value 5, then calculate with it.
=LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7), avg)The four overdue balances average 750. Returning the name on its own shows what it holds.
=LET(total, SUMIF(B2:B7, "Overdue", C2:C7), n, COUNTIF(B2:B7, "Overdue"), total/n)Names come in pairs before the final calculation, which can use all of them.
=LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7), COUNTIFS(B2:B7, "Overdue", C2:C7, ">"&avg))B-1 (900) and B-4 (1200) are overdue and above 750. This is what the video below builds, in E2.
Watch it done in Excel
The last example above, recorded in real Excel on the same grid.
Exam traps
=LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7), COUNTIFS(B2:B7, "Overdue", C2:C7, ">avg")) returns 0: it compares the balances with the text avg. Join the operator to the name: ">"&avg.
LET must end with the calculation. =LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7)) is not a formula Excel will accept.
=COUNTIFS(B2:B7, "Overdue", C2:C7, ">"&AVERAGEIF(B2:B7, "Overdue", C2:C7)) also returns 2, but a task that says “use LET” checks for it, and this formula fails that check.
Pick a word Excel cannot read as a reference, such as avg or total. A name like C2 is a cell, and Excel will not take it as a LET name.
FAQ
Can a later name use an earlier one?
Yes. =LET(a, 2, b, a*3, b+1) returns 7: b is worked out from a.
Does LET change the answer?
No. It returns the same result as the formula written out in full; it only avoids working the same thing out twice.
Can a name be a whole word?
Yes, and a word makes the formula easier to read. =LET(total, 5, total*2) returns 10.
New to this function?
This page covers what the exam asks. For the full how-to — every argument, more examples and a practice workbook — read our guide on dfwexcel.com.
The LET function, explained — dfwexcel.comTry it under exam conditions
Take a full, timed MO-211 practice exam, upload the workbook you built, and get a score out of 1000 with a per-task breakdown of where the points went. Your first one is free.
No credit card needed.
