3.4 AVERAGE, AVERAGEIF(S), MINIFS and MAXIFS
Ask which population an average describes
Someone reviewing a fictional delivery report asks for the average time in Pune and the fastest delivered order. Both questions use the minutes column, but one describes the center of a group and the other picks its lowest value. The answer also depends on whether an order must be delivered to qualify.
Use the chapter's ten-row Orders fixture. It contains made-up Blinkit and Amazon Now examples. The brands provide a recognizable context only. The times, order values and report rules are fictional. Find Pune in C, Amount in G, Mins in H and Status in I. The rows are numbered 2 through 11 and are arranged as one order per row.
One group can produce several numbers
- Average across all Pune rows. Minutes are 9, 14, 8 and 13. Add them for 44, then divide by four to get 11. The last value comes from a cancelled order. Include it only when the question asks for the minutes field across all listed Pune statuses.
- Average only among delivered Pune rows. Keep 9, 14 and 8. Their total is 31 and there are three numeric values, yielding about 10.33 minutes per delivered order in Pune.
- Fastest and slowest delivered Pune orders. The same three rows give a minimum of eight and a maximum of fourteen minutes. These are endpoint observations from the group. Neither number tells you what the average is on its own.
Build an arithmetic mean from its parts
The arithmetic mean gives each eligible numeric observation equal influence. It adds the values and divides by how many values it added. For a worksheet range of minutes, =AVERAGE(H2:H11) computes that measure with one function call. Verify it independently by dividing SUM(H2:H11) by COUNT(H2:H11) for this complete numeric dataset. Here all ten times add to 128 and the average is 12.8 minutes.
Read the denominator as carefully as the result
The denominator is the divisor, the number of numeric observations that contributed. The numerator is the sum you are dividing. If one duration was never entered, the row still exists. An average across the numeric durations can exclude its missing value. A teammate should not divide a nine-value sum by ten rows unless the report has an explicit policy assigning a value to the missing duration.
- Numeric zero. A cell containing zero contributes a real number of zero and still adds one to the denominator. In a practice queue with 6, 0 and 12 minutes, you divide eighteen by three and get six.
- Empty cell. With 6 and 12 and one genuinely empty cell, the numeric range average divides eighteen by two and gives nine. The amounts you added did not change. The denominator did.
- Text in a numeric column. A range-based AVERAGE ignores text cells, including a number stored as text. Check the actual input types if part of the list came from an export. An omitted text value can produce a plausible result with an incomplete population.
- Stored error. A source error is evidence of a formula or data problem. AVERAGE can return an error when its referenced inputs contain errors. Inspect the failing source instead of treating a failed timing as a recorded zero.
Operators can be useful for the hand check because they expose the two components. However, the quotient must have a nonzero count, and the numerator and denominator must represent the same list. If you limit the sum to delivered orders, limit the count to those delivered orders that have eligible amounts. In this useful classroom fixture every order's Amount and Mins are numeric, so a status count matches the count of eligible numeric values.
Keep values precise until display
The Pune delivered mean of 31 divided by three repeats in decimal. Displaying two decimal places gives approximately 10.33. Keeping the underlying precision allows you to use the result in another calculation without rounding it early. When the business rule requires a rounded output stored by the formula, use the rounding methods in the next lesson and name the precision expected.
Choose a conditional average or a conditional extreme
AVERAGEIF reads one test
Use =AVERAGEIF(C2:C11,"Pune",H2:H11) to average durations where City is Pune. The first range is the one Excel tests. The second argument gives the criterion. The optional third range supplies the numbers to average when they differ from the cells you test. Omitting the third range asks Excel to average the values in the test range. For example, you could test numeric times and average the same selected times.
AVERAGEIFS reads multiple tests
Use =AVERAGEIFS(H2:H11,C2:C11,"Pune",I2:I11,"Delivered") for Pune delivered minutes. The average range is first. City and Status appear as range-and-criterion pairs, just as in SUMIFS after its first argument. Each included duration must come from a row where every required condition is true.
MINIFS and MAXIFS ask for one boundary value
Use =MINIFS(H2:H11,C2:C11,"Pune",I2:I11,"Delivered") for the smallest time in the group and =MAXIFS(H2:H11,C2:C11,"Pune",I2:I11,"Delivered") for the largest. Both functions read the values to compare first. Test ranges and criteria come next. Change the value range to G to find the minimum or maximum amount under the same conditions. The qualifying rows stay the same while the unit of the result changes.
The conditional extreme functions return the numeric value, such as fourteen. If two orders share that value, it remains the highest observed time. Finding the associated IDs is a separate question. A filter can show all records matching the status, city and extreme value. Checking IDs matters when a team wants to inspect the records themselves, as opposed to displaying only a number.
Lab 1 · Build an average and fastest-to-slowest view
Open a fresh copy of the ten-order sheet. Put explanatory labels in K and formula results in L. Begin with the whole source, then restrict the population, and compare each answer with the expected matched records. Enter the formulas on Orders so the addresses in the examples point to the correct inputs.
Compute four averages for different populations
- Use
=AVERAGE(H2:H11)for all listed minutes. Expect 12.8. Compare against the total of 128 and count of ten. The label should say “all listed orders,” since all statuses contribute. - Use
=AVERAGEIF(C2:C11,"Pune",H2:H11)for all Pune order timings. Expect 11. Use rows 2, 4, 7 and 10 to check the count and sum. - Use
=AVERAGEIFS(H2:H11,C2:C11,"Pune",I2:I11,"Delivered")for delivered Pune. Expect about 10.33. Verify the cancelled order no longer contributes thirteen minutes and the denominator drops from four to three. - Use
=AVERAGEIFS(H2:H11,I2:I11,"Delivered")for all delivered timings. The formula uses one condition in the plural form. Expect about 13.43, from ninety-four minutes across seven delivered rows. Write the population into the result's label.
Use the same eligible records to look for endpoints
- Enter
=MINIFS(H2:H11,C2:C11,"Pune",I2:I11,"Delivered")and then the matching MAXIFS. The results are eight and fourteen. Verify the rows with those durations. They should both have City Pune and Status Delivered. - For delivered orders across all cities, use
=MINIFS(G2:G11,I2:I11,"Delivered")and the corresponding MAXIFS. They return ₹64 and ₹1,299. Notice that these are prices, even though the previous endpoint measurements were times. Compare amount and minutes ranges when a figure's unit seems wrong. - Check the fastest delivered Nashik order using City Nashik and Status Delivered on the minutes range. The two matching times are twelve and seventeen. The minimum is twelve.
- Calculate the delivered average order value with
=AVERAGEIFS(G2:G11,I2:I11,"Delivered"). Check against ₹2,215 divided by seven, approximately ₹316.43. The denominator here is eligible orders with numbers. A quantity-based question would require a different divisor.
| Population | Numeric times | Sum | Mean (min) | Fastest | Slowest |
|---|---|---|---|---|---|
| All orders | 10 | 128 | 12.80 | 8 | 18 |
| Pune, any status | 4 | 44 | 11.00 | 8 | 14 |
| Pune, delivered | 3 | 31 | 10.33 | 8 | 14 |
| All delivered | 7 | 94 | 13.43 | 8 | 18 |
Trace the effect of a single status edit
Begin from the delivered group
Pune has three delivered times: nine, fourteen and eight minutes. Their sum is 31. The mean is about 10.33 and its endpoints are eight and fourteen.
Read the excluded fourth order
Row 10 belongs to Pune and took thirteen minutes. The Cancelled status is the reason it does not contribute to the delivered results.
Change only status
In a practice copy, change I10 to Delivered. The sum in the delivered Pune group becomes 44, now over four orders. The mean rises to 11.
Explain the endpoints
Thirteen sits between eight and fourteen, so the minimum and maximum stay the same. Restore Cancelled and confirm the mean returns to about 10.33.
This edit is a way of distinguishing three summaries of the same group. Every eligible observation can move the mean. A new observation changes the minimum only when it beats the current smallest, and changes the maximum only when it beats the current largest. Tracking the three outputs tells a more complete story than any one of them alone.
Explain an empty group explicitly
Try a delivered Nagpur calculation on the original fixture. There is a Nagpur order, but it was cancelled. =COUNTIFS(C2:C11,"Nagpur",I2:I11,"Delivered") returns zero. Under those criteria, AVERAGEIFS returns #DIV/0! because there are no eligible observations to average. MINIFS and MAXIFS return zero when no cells match. That zero is not an observed delivery time here.
Show the population beside every conditional result
Put the matching count or a status label next to the reported metric. For this clean numeric fixture, the matching record count is the numeric observation count. You can write an explicit long-form condition: when the count of delivered rows for the selected city is zero, show No delivered orders. When it is positive, show the requested measure. Use an IF formula once your count is independently verified.
=IF(COUNTIFS(C2:C11,"Nagpur",I2:I11,"Delivered")=0,"No delivered orders",MINIFS(H2:H11,C2:C11,"Nagpur",I2:I11,"Delivered"))
That expression uses the same scope twice so the condition reports on the same records the minimum would describe. It guardrails this no-match case. If the source can contain missing or invalid measurements, add a checked value-type or measurement-status column and include the eligibility test in both formulas. A record count may be positive even when no eligible numeric data exists. Compare those two counts before reporting a minimum of zero.
Lab 2 · Separate average lot price from cost per unit
A fictional marketplace seller listing goods on Amazon compares three stock purchases. The supplier charged different per-unit prices and sold different quantities. The seller asks, “What did one unit cost on average across all twenty units?” Taking an ordinary average of three prices gives each purchase equal weight. It will not give each unit equal weight when the purchase quantities differ.
Create a new worksheet named Purchases. In row 1 make headings Batch, Units, Unit price and Line cost. Enter A through C from the table and leave D for calculation. The figures are made-up purchase costs for the exercise. No fees or additional costs are assumed.
| Row | A Batch | B Units | C Unit price | D Expected cost |
|---|---|---|---|---|
| 2 | A | 2 | 100 | 200 |
| 3 | B | 8 | 40 | 320 |
| 4 | C | 10 | 50 | 500 |
Find the population of batches and the population of units
- In D2 enter
=B2*C2and fill down through D4. Verify 200, 320 and 500 on the three rows. Check a batch by multiplying its own quantity and price. This gives you the cost paid for each batch. - In an empty cell enter
=AVERAGE(C2:C4). The result is about ₹63.33. It is the mean of three listed batch-level unit prices. Each batch contributed one price, even though their quantities differ. - Use
=SUM(D2:D4)to find ₹1,020 in total goods cost. Use=SUM(B2:B4)to find twenty purchased units. Calculate=SUM(D2:D4)/SUM(B2:B4). The result is ₹51 per unit. The denominator is units, and the numerator includes the cost of those same units. - Try
=SUMPRODUCT(B2:B4,C2:C4)/SUM(B2:B4)in another spare cell. SUMPRODUCT multiplies paired quantities and prices and then adds their products. The division uses the quantity total. It should agree with ₹51 from the checked helper column. - In a scratch copy, increase batch B from eight to ten units without changing its price. The cost rises to ₹1,100 and the quantity to twenty-two. The unit average falls to ₹50. The ordinary average of the three listed prices stays at about ₹63.33. The extra units cost ₹40 each, which draws the per-unit result down. Restore batch B to eight afterward.
In a weighted average, each observation is given influence in proportion to a supplied weight. The weights here are quantities. The first price appears twice, the second appears eight times and the third appears ten times if you list each unit individually. Grouping the identical items by purchase lets you get the same result without writing twenty separate rows.
Combine group averages using their observation counts
Suppose a report shows a delivered mean separately for each city. Pune had three measured orders and a total of 31 minutes. Nashik had two and 29. Kolhapur had one and sixteen. Solapur had one and eighteen. Combining the city groups by summing their total minutes and dividing by their combined measured count returns 94 divided by seven, or about 13.43 minutes. That gives every measured order one equal vote.
Taking the unweighted mean of the four displayed city means instead gives about 14.71 minutes before rounding. In that calculation each city's mean has equal influence, even if it summarizes only one order. A small city receives the same influence as a city with several orders. This may be a valid city-level metric if that is the research question. It describes a different population from average minutes over every delivered order.
- To rebuild an overall order average from group metrics, use each group's observation count as its weight. If the source gives you sum and count directly, combine those before dividing.
- Keep more precision than the displayed city mean when combining. Multiplying a rounded group average back by its count can introduce a difference compared with summing the original durations.
- Handle groups with no measured observations according to the report definition. Their count and sum contribute nothing to an overall per-order calculation. Do not invent a city mean from an empty group to fill a display cell.
Tell the whole story when the mean hides a pattern
Compare a mean with a median
In a separate fictional Netflix-inspired playback practice sheet, forget the order data and enter five invented measured times: 8, 9, 10, 11 and 42 seconds. These illustrate calculation only. Their sum is eighty and the mean is sixteen. The median is the center observation once the values are ordered. With five values, that is the third entry, ten. Replacing 42 with 12 brings the mean down to ten, and the median stays ten. A rare long event can move the mean noticeably without changing the middle of the group.
For an even number of observations, the median averages the two middle values. On the ten actual exercise order amounts, it averages 195 and 220 to give ₹207.50. Try =MEDIAN(G2:G11). Compare it with the all-status arithmetic mean of ₹287. The unusually large ₹1,299 order affects the arithmetic mean strongly. Use labels so a reader knows which definition of a typical value was selected.
Look at a second or third position
=LARGE(G2:G11,2) returns ₹270, the second amount when the values are ordered from largest to smallest. The third is ₹240. =SMALL(G2:G11,2) picks the second-smallest observation and gives ₹90 in this example. These functions count positions among observations, including duplicates when the same number appears more than once. For the second distinct value, prepare a distinct list first.
Explore frequency and dispersion separately
The mode is a value that appears most often. A mode function can be helpful for repeated codes or counts, after you verify that the data type is appropriate. MODE.SNGL on the ten distinct numeric order amounts reports #N/A because there is no repeated value. For duration spread, a later statistics exercise might use STDEV.S if the data is treated as a sample. It measures how far observations typically move around their mean, in the same unit as the measurement. Choose the sample or population definition deliberately before applying an additional statistic.
Practice extension · separate status from measured time
Make a new tab named Queue with columns A Request, B State, C Minutes and D Numeric minutes?. A fictional Instagram support practice queue supplies four records. Two finished requests had measured times of six and twelve minutes. One finished request has no stored time yet. One open request has twenty minutes recorded as its current queue age. The field on that last row represents another stage of the process, so the completed-time report explicitly excludes it.
| Row | Request | State | Minutes |
|---|---|---|---|
| 2 | IG-901 | Finished | 6 |
| 3 | IG-902 | Finished | 12 |
| 4 | IG-903 | Finished | Leave empty |
| 5 | IG-904 | Open | 20 |
Test an explicit eligibility field
- In D2 type
=ISNUMBER(C2)and fill through D5. It returns TRUE for 6, 12 and 20, and FALSE for C4. You now have a simple marker for which cells hold numbers. It does not enforce a particular time range. - Use
=COUNTIF(B2:B5,"Finished")to count three finished requests. Use=COUNTIFS(B2:B5,"Finished",D2:D5,TRUE)separately to count two finished requests with numeric observations. The difference points to the finished request with missing data. - Enter
=AVERAGEIFS(C2:C5,B2:B5,"Finished",D2:D5,TRUE). The result is nine. Use the same pairs in MINIFS and MAXIFS to establish six and twelve as the reported endpoints. The twenty-minute age of the open request fails the state criterion, while the empty timing fails the eligibility check. - Now type a numeric zero in C4 for a controlled test. The eligible count becomes three. The average of six, twelve and zero becomes six. The minimum becomes zero and the maximum stays twelve. Here a real numeric zero changes the data. Clear it again afterward.
- Enter 9 in C4 as a verified new measurement. The eligible count is now three. The mean is still nine because the added value equals the prior mean. The new measurement changed coverage and left the mean and extremes unchanged. Confirm that your report surfaces the count change in its own cell.
Some teams choose additional eligibility checks. A duration could be limited to a known reporting window, and a date stored in the wrong column could pass ISNUMBER while making no sense as elapsed minutes. Put those checks in one clearly named helper and prove it on the usual values and boundary cases. The purpose of the helper is to state which values you intend the summary to use.
Find the recorded order that gave an extreme
Finding a maximum lets you say how large an amount or time was. When another person asks which order it came from, look up the record using the same qualifying conditions as the aggregate. If an unrelated order in another city has the same recorded time, the number alone does not identify the desired order.
- Use the original Orders fixture and use MAXIFS for delivered Pune minutes. The answer is fourteen. Inspect the original rows to find AMN-1003 with Pune, Delivered and fourteen.
- In an expendable practice copy, change H7 from eight to fourteen. There are now two qualifying Pune delivered orders with that time. MAXIFS still gives fourteen. A filter for the correct group and that reported value now yields AMN-1003 and BLK-1006.
- Use a COUNTIFS with City Pune, Status Delivered and a numeric fourteen-minute criterion to confirm the number of matching orders. It returns one before the H7 change and two after. The maximum itself stays the same because it returns the boundary value.
- If the team requires a single selected order despite ties, ask them for a tie-breaking policy such as earliest record date. That selection needs more data and logic than a maximum alone. Keep the policy visible for review.
Keep the same H7 edit long enough to predict the other measures. The eligible total rises from 31 to 37 minutes. The count is still three. The mean rises to about 12.33 and the minimum rises from eight to nine. The maximum has no reason to move because you added a value equal to the existing largest one. On a report that only watches the maximum, the change would be invisible. Restore H7 after verifying the three measures.
As a separate check of the raw source, try comparing the city group with the largest order across the whole sheet. The fourteen-minute maximum in Pune is a time, while ₹1,299 in Solapur is an amount. These are different questions even though both use a maximum. Keep the field name beside the result so the summary does not invite someone to compare unrelated units.
Audit the source and the population together
Use the routine below if an average or extreme is surprising. Each step narrows the problem to a specific part of the calculation.
- Reconstruct the eligible group. Identify the records that meet every criterion. If the question says delivered, check Status. If it says a particular city, check City. Verify which of those records carry the expected numeric input.
- Check range size and start position. AVERAGEIFS, MINIFS and MAXIFS need compatible ranges with the same dimensions. Matching the dimensions does not correct a one-row offset. Use corresponding cells for every row and read both boundaries from the formula.
- Check AVERAGEIF's third argument. In a formula with one condition, put the range to test first and the optional average range at the end. Excel can extend the average cells from the first cell you supplied to match the test range shape. Enter the whole intended average range so the report makes its scope explicit.
- Check the measurement unit. All times here are numbers of minutes. A colleague who appends seconds without converting them will change the meaning of the mean. Similarly, comparing elapsed clock fractions to integer minutes requires a conversion before comparison.
- Check missing and special values. Count observations, error or missing flags and real zeros separately. A visible zero at an extreme might come from an empty group. An error in an average can come from the input or from the lack of a numeric denominator. Investigate before hiding the difference behind a fallback.
- Check which version of the workbook you have. Microsoft's current documentation lists MINIFS and MAXIFS for supported releases including Excel 2019 and later and Microsoft 365. If the client does not recognize the function, use a supported Excel version or use an explicitly filtered numeric set on a scratch tab to check the result independently.
Publishing a minimum and maximum can remind a reader that the average does not describe every record. Combine them with the count when a group is small. If all three values are close together, the measurements might be fairly concentrated. If one endpoint is much farther away, inspect the records and context before treating the mean as a typical experience.
Build an average order value the reader can interpret
The phrase average order value in the Orders fixture means the arithmetic mean of the eligible amount cells, in rupees per order. Follow all seven delivered records first. Their amounts total ₹2,215, and their counts of units add to seventeen. Dividing amount by order count gives about ₹316.43 per order. Dividing by units gives about ₹130.29 per listed unit. Both calculations use the same combined amount. One denominator counts order rows and the other sums pieces of quantity.
Use the reported platform field to define the group
Try =AVERAGEIF(D2:D11,"Blinkit",G2:G11) over all statuses. It gives about ₹333.29 because the seven matching order amounts total ₹2,333. Add Delivered through an AVERAGEIFS call and you get a different set. The five delivered Blinkit rows have total amount ₹1,873, or ₹374.60 per delivered order. The two delivered Amazon Now rows add to ₹342, or ₹171 per delivered order. Every number is a result for this fictional sample. A practice table with five orders on one platform and two on another cannot establish what usually happens at either company.
- Verify the numerator. Use a conditional sum for the total amount of each delivered platform group. Their results add to ₹2,215. This reconciliation works because every delivered row has exactly one of the two platform labels in the fixture.
- Verify the denominator. Use a conditional count for each group. Five plus two gives seven. Since all amounts in this sample are numeric, the count of matching records equals the count of numbers the average uses.
- Verify the overall result. Compute the weighted mean of the platform averages using their respective order counts, or divide the combined total by the combined count. This recovers approximately ₹316.43. An equal average of ₹374.60 and ₹171 gives ₹272.80 and describes an equal-weight average of the two platform means.
- Choose what to display. Present the amount, count and mean together. A much larger group with a slightly different mean may matter more to the overall result than a small group with an extreme mean.
Keep the calculation separate from the conclusion
A mean does not tell you why one group has a different number. Different quantities, categories or order sizes can influence this practice dataset. Before drawing a conclusion, check the sample counts and ask whether you are comparing comparable orders. For a useful exercise, restrict both platform groups to the same product category where they have observations and see which rows remain. The formula can implement that restriction, while your notes explain what population the result actually represents.
Quiz · choose the group and the statistic
All Pune times sum to 44. What is their mean, and what changes when you restrict them to delivered?
Across four Pune rows the mean is eleven. Restricting to Delivered drops the cancelled thirteen-minute row. The remaining 31 minutes across three observations give about 10.33.
Two cells hold six and twelve. How does a third numeric zero affect the mean?
The sum remains eighteen. The numeric count increases from two to three, so the mean falls from nine to six. An actually empty third cell would keep the original numeric count.
What does a MINIFS zero mean when no records match?
There is no observed minimum in that group. MINIFS can return zero anyway. Pair the result with the verified eligible count or report no observations explicitly.
Should you average the three inventory batch prices for cost per physical unit?
Use total stock cost divided by purchased units. The three listed prices describe groups of unequal size. Their equal-weight mean is about ₹63.33, while the per-unit result across the entire purchase is ₹51.
If the delivered Pune group adds a thirteen-minute record, do the endpoints move?
No. Thirteen lies between eight and fourteen. The average moves because a new eligible record contributes both its time and one observation to the calculation.
Which number better describes the middle of 8, 9, 10, 11 and 42?
The median is ten, the middle observed value after sorting. The mean is sixteen because it includes the magnitude of forty-two. The better report depends on the question, which should name the statistic used.
Interview practice · read each metric aloud
What does AVERAGEIFS add beyond AVERAGEIF?
It accepts multiple conditions and starts with the values to average. I would use it to keep Pune and Delivered together. Then I would add the eligible minutes and divide by the eligible numeric count to verify one sample result.
How can the mean stay the same when a new measured row arrives?
A new observation equal to the current mean can keep the same ratio. In the queue example, adding nine to six and twelve gives twenty-seven divided by three, still nine. Showing the count makes the change in coverage visible.
Why do team averages often need weights to be combined?
Each team can have a different number of observations. If the overall metric is per order, I would add the team sums and counts and divide. Giving each team mean equal influence answers a per-team question.
How do you use MAXIFS when the team also wants order IDs?
First find the maximum within the correct group. Then filter the original records by that value and the same city and status. I would report every matching ID or follow a stated tie rule when they need one.
What would you inspect when a documented average is wrong?
I would verify the population and eligible numeric count first. Then I would compare the numerator with a sum of known matches, check for empty cells and text values, and confirm that the unit in the source agrees with the label.
Six cards for the group-and-measure decision
- Mean Add eligible numeric values and divide by their count. Declare the unit of the result.
- Blank and zero A blank cell does not increase the numeric count. A recorded zero does.
- Criteria AVERAGEIF tests one condition. AVERAGEIFS starts with the values and follows with each required pair.
- Extremes MINIFS and MAXIFS return the eligible boundary value. Check for no matches and ties separately.
- Weights Sum the comparable totals and divide by the matching weighted population. Verify the units or observation counts.
- Independent checks Show the eligible count, the sum and at least one matching row when you need to prove a statistic.
Continue with rounding and ranking. For more about how a report can count eligible and missing entries, revisit the COUNT family.
Microsoft references
- AVERAGE function and numeric value behavior
- AVERAGEIF function and range behavior
- AVERAGEIFS and no-match behavior
- MINIFS, compatible ranges and the no-match example
- MAXIFS, compatible ranges and the no-match example
- Calculate arithmetic and weighted averages
- Statistical functions including MEDIAN, LARGE, SMALL and MODE.SNGL
Continue practising: explore the existing Excel Task Hub for additional exercises.