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

Deliveries
ABC
1DriverRegionMiles
2KimNorth60
3LeeSouth65
4RayNorth58
5SamSouth31
6TiaEast77
7UmaNorth50
Longest run (the video fills F2:F4)
EF
1RegionLongest
2South65
3North60
4West0
One condition
=MAXIFS(C2:C7, B2:B7, "North")
Returns 60

The North runs are 60, 58 and 50.

Two conditions
=MAXIFS(C2:C7, B2:B7, "North", C2:C7, "<60")
Returns 58

The longest North run under 60 miles.

Nothing matches
=MAXIFS(C2:C7, B2:B7, "West")
Returns 0

There are no West deliveries, and MAXIFS returns 0 rather than an error.

Filled down a column
=MAXIFS($C$2:$C$7, $B$2:$B$7, E2)
Returns 65, 60, 0 in F2:F4

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

Trusting a 0

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

Filling down without locking

Unlocked, the formula in F2 filled to F3 searches rows 3 to 8. North loses Kim's 60 and shows 58.

The ranges in the wrong order

=MAXIFS(B2:B7, C2:C7, "North") looks for North among the miles and the maximum among the region names, and returns 0.

Expecting the name

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