Perform logical operations by using the AVERAGEIF() function
=AVERAGEIF($B$2:$B$7, E2, $C$2:$C$7)Average the hours on the rows whose team matches E2. Like SUMIF, the range to average goes last; lock both ranges before you fill it down.
What the MO-211 task asks
An AVERAGEIF task asks for the average of one subset: “return the average Balance Due across the berths whose Dock is C”. One condition and an average is AVERAGEIF; two or more conditions is AVERAGEIFS.
Check whether every category in the task actually occurs in the data. When no row matches, AVERAGEIF has nothing to divide by and shows #DIV/0!, which is a real result, not a mistake in your formula.
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 | Ticket | Team | Hours |
| 2 | T-1 | Billing | 4 |
| 3 | T-2 | Tech | 9 |
| 4 | T-3 | Billing | 2 |
| 5 | T-4 | Tech | 6 |
| 6 | T-5 | Sales | 5 |
| 7 | T-6 | Tech | 3 |
| E | F | |
|---|---|---|
| 1 | Team | Avg hours |
| 2 | Tech | 6 |
| 3 | Billing | 3 |
| 4 | Sales | 5 |
| 5 | Legal | #DIV/0! |
=AVERAGEIF(B2:B7, "Tech", C2:C7)The three Tech tickets took 9, 6 and 3 hours: 18 divided by 3.
=AVERAGEIF(C2:C7, ">=6")With no third argument, AVERAGEIF averages the cells it tested: 9 and 6.
=AVERAGEIF(B2:B7, "Legal", C2:C7)No ticket belongs to Legal, so there is nothing to average.
=AVERAGEIF($B$2:$B$7, E2, $C$2:$C$7)One formula, filled down, with the ranges locked. Legal has no tickets. 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
It means no row met the condition. Retyping the formula will not change it; check the category name against the data instead.
=AVERAGEIF(B2:B7, "Tech") tries to average the team names themselves and returns #DIV/0!. When the condition is on one column and the numbers are in another, the third argument is required.
Unlocked, =AVERAGEIF(B2:B7, E2, C2:C7) filled down moves both ranges a row at a time. In F3, Billing loses T-1 and averages 2 instead of 3.
AVERAGEIF tests first and averages last; AVERAGEIFS averages first. =AVERAGEIF(C2:C7, "Tech", B2:B7) tests the hours for the word Tech and returns #DIV/0!.
FAQ
Is the condition case-sensitive?
No. =AVERAGEIF(B2:B7, "tech", C2:C7) returns 6.
Can I use wildcards?
Yes. =AVERAGEIF(B2:B7, "B*", C2:C7) averages the teams starting with B — only Billing here — and returns 3.
How do I show 0 instead of #DIV/0!?
Only if the task asks for it. Test the count first: =IF(COUNTIF(B2:B7, "Legal")=0, 0, AVERAGEIF(B2:B7, "Legal", C2:C7)) returns 0.
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 AVERAGEIF 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.
