Perform logical operations by using the MAXIFS() function
=MAXIFS($C$2:$C$7, $B$2:$B$7, E2)Return the longest run among the rows whose region matches E2. The range to take the maximum from comes first, then range and condition pairs.
What the MO-211 task asks
A MAXIFS task asks for the largest value in a subset: “return the greatest vessel Length, counting only the berths whose Dock is D”, or “return the greatest Miles among the journeys whose helper value is 7”. “Greatest”, “largest” or “highest … counting only” is MAXIFS.
The arguments follow SUMIFS: the range to search for the maximum first, then pairs. One trap is worth knowing before the exam: when no row matches, MAXIFS returns 0, which looks like a real answer.
Our grader checks the value in every cell of the target range. It reads the values, not the function, so any formula that produces them earns the points — but one wrong cell fails the whole range.
Worked examples
Type these into a blank sheet to follow along. Every result below is what Excel showed.
| A | B | C | |
|---|---|---|---|
| 1 | Driver | Region | Miles |
| 2 | Kim | North | 60 |
| 3 | Lee | South | 65 |
| 4 | Ray | North | 58 |
| 5 | Sam | South | 31 |
| 6 | Tia | East | 77 |
| 7 | Uma | North | 50 |
| E | F | |
|---|---|---|
| 1 | Region | Longest |
| 2 | South | 65 |
| 3 | North | 60 |
| 4 | West | 0 |
=MAXIFS(C2:C7, B2:B7, "North")The North runs are 60, 58 and 50.
=MAXIFS(C2:C7, B2:B7, "North", C2:C7, "<60")The longest North run under 60 miles.
=MAXIFS(C2:C7, B2:B7, "West")There are no West deliveries, and MAXIFS returns 0 rather than an error.
=MAXIFS($C$2:$C$7, $B$2:$B$7, E2)Each row reads its region from column E, across the same locked ranges. This is what the video below builds.
Watch it done in Excel
The last example above, recorded in real Excel on the same grid.
Exam traps
=MAXIFS(C2:C7, B2:B7, "West") returns 0 for a region with no deliveries. If a 0 appears, check the condition matches the data's spelling before you move on.
Unlocked, the formula in F2 filled to F3 searches rows 3 to 8. North loses Kim's 60 and shows 58.
=MAXIFS(B2:B7, C2:C7, "North") looks for North among the miles and the maximum among the region names, and returns 0.
MAXIFS returns the value, not who it belongs to. To name the driver, look the value up: =XLOOKUP(MAXIFS(C2:C7, B2:B7, "North"), C2:C7, A2:A7) returns Kim.
FAQ
What does MAXIFS do with text?
It skips it. =MAXIFS(A2:A7, B2:B7, "North") returns 0: the driver names are text, so there is no number to compare.
Can the condition be a comparison?
Yes. =MAXIFS(C2:C7, C2:C7, "<65") returns 60, the longest run under 65 miles.
Is the condition case-sensitive?
No. =MAXIFS(C2:C7, B2:B7, "north") returns 60.
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 MAXIFS 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.
