Maintenance Notification: We are upgrading our servers today so you may experience intermediate outages. Thank you for your patience.
Perform logical operations in formulas
MO-211

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.

Berths (the video fills E2)
ABCDE
1BerthStatusBalanceAbove avg
2B-1Overdue9002
3B-2Paid150
4B-3Overdue300
5B-4Overdue1200
6B-5Paid400
7B-6Overdue600
The smallest LET
=LET(x, 5, x*2)
Returns 10

Name x, give it the value 5, then calculate with it.

Naming a calculation
=LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7), avg)
Returns 750

The four overdue balances average 750. Returning the name on its own shows what it holds.

Two names
=LET(total, SUMIF(B2:B7, "Overdue", C2:C7), n, COUNTIF(B2:B7, "Overdue"), total/n)
Returns 750

Names come in pairs before the final calculation, which can use all of them.

Named once, reused
=LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7), COUNTIFS(B2:B7, "Overdue", C2:C7, ">"&avg))
Returns 2

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

The name inside quotes

=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.

No final calculation

LET must end with the calculation. =LET(avg, AVERAGEIF(B2:B7, "Overdue", C2:C7)) is not a formula Excel will accept.

Getting the value right without LET

=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.

A name that is a cell address

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.com

Try 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.