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 AVERAGEIFS() function

=AVERAGEIFS($C$2:$C$7, $A$2:$A$7, E2, $B$2:$B$7, F2)

Average the orders on the rows where the city matches E2 and the shift matches F2. The range to average comes first, as in SUMIFS.

What the MO-211 task asks

An AVERAGEIFS task asks for an average of a subset defined by two or more conditions: “return the average Result across the rows where the Client is Meridian Foods AND the Matrix is Syrup. Both conditions must hold.”

The range to average goes first, then the ranges and conditions in pairs. When no row meets every condition, the result is #DIV/0!: there is nothing to average.

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.

Orders by shift
ABC
1CityShiftOrders
2DallasDay40
3DallasNight22
4AustinDay35
5DallasDay50
6AustinNight18
7AustinDay41
Averages (the video fills G2:G4)
EFG
1CityShiftAvg orders
2AustinDay38
3DallasDay45
4HoustonDay#DIV/0!
Two conditions
=AVERAGEIFS(C2:C7, A2:A7, "Dallas", B2:B7, "Day")
Returns 45

The two Dallas day shifts took 40 and 50 orders.

A number condition
=AVERAGEIFS(C2:C7, B2:B7, "Day", C2:C7, ">40")
Returns 45.5

Day shifts with more than 40 orders: 50 and 41. Exactly 40 does not count, because the test is >.

Nothing matches
=AVERAGEIFS(C2:C7, A2:A7, "Houston")
Returns #DIV/0!

No row is in Houston, so there is nothing to average.

Filled down a column
=AVERAGEIFS($C$2:$C$7, $A$2:$A$7, E2, $B$2:$B$7, F2)
Returns 38, 45, #DIV/0! in G2:G4

Each row reads its city and shift from columns E and F, 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

The range to average in the wrong place

AVERAGEIF puts it last; AVERAGEIFS puts it first. =AVERAGEIFS(A2:A7, "Dallas", C2:C7) leaves the arguments unpaired, and Excel will not accept the formula.

Filling down without locking

Unlocked, the formula in G2 filled to G3 tests rows 3 to 8. Dallas Day loses row 2 and averages 50 instead of 45.

Ranges of different sizes

=AVERAGEIFS(C2:C7, A2:A6, "Dallas") returns #VALUE!. Every range in the formula must be the same size.

#DIV/0! read as a mistake

It means no row met every condition. Check each condition against the data — a city or shift spelled differently from the sheet is the usual cause.

FAQ

Can the conditions come from cells?

Yes, as in the filled-down example. =AVERAGEIFS(C2:C7, A2:A7, E3, B2:B7, F3) returns 45, reading Dallas and Day from E3 and F3.

How do I show 0 instead of #DIV/0!?

Only if the task asks for it. Test the count first: =IF(COUNTIFS(A2:A7, "Houston")=0, 0, AVERAGEIFS(C2:C7, A2:A7, "Houston")) returns 0.

Is the condition case-sensitive?

No. =AVERAGEIFS(C2:C7, A2:A7, "dallas", B2:B7, "day") returns 45.

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