Average if with Filter? Excel AVERAGEIF vs FILTER
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator works out the average of a list of numbers after you apply a filter, giving you the mean of only the values that meet your condition. You enter the full list of numbers and a condition (for example, values greater than 10), and it returns the average of those matching values. It is the same logic as Excel’s AVERAGEIF function, but without needing a spreadsheet.
Formula
The average of a filtered list is the sum of the values that meet the condition divided by the count of those values. In symbols:
Average = (xâ‚� + xâ‚‚ + … + xâ‚™) / n
where xâ‚�, xâ‚‚, … are the numbers that satisfy the condition, and n is how many of them there are. The condition uses comparison operators: > (greater than), < (less than), >= (greater than or equal), <= (less than or equal), = (equal), and <> (not equal). For example, a condition of >10 means you keep only the numbers that are strictly greater than 10.
This is exactly what Excel’s AVERAGEIF function does: AVERIF(range, criteria) averages the cells in a range that match the criteria. The criteria can be a number, expression, or text.
Worked Example
Using the default values from the calculator above:
- Numbers: 5, 12, 8, 20, 3, 15
- Condition: >10
Step 1: Identify which numbers are greater than 10.
12 > 10 → yes
20 > 10 → yes
15 > 10 → yes
5, 8, 3 are not.
So the filtered list is: 12, 20, 15.
Step 2: Sum the filtered values: 12 + 20 + 15 = 47.
Step 3: Count them: 3.
Step 4: Divide: 47 / 3 = 15.67 (rounded to two decimals).
The calculator returns 15.67, matching the manual calculation.
When to Use a Filtered Average
You use a filtered average when you want the typical value of a subset of your data, not the whole set. Common situations:
- Average sales per day, but only for days above a certain threshold (e.g., >100 units).
- Average test score of students who passed (score >= 60).
- Average response time of support tickets that took longer than 5 minutes.
- Average temperature on days that were hotter than 30°C.
The key is that you have a reason to exclude some values. If you just want the mean of all numbers, you don’t need a filter.
How to Read the Result
The result is the arithmetic mean of the numbers that pass the filter. It is not the median, not the mode, and not a weighted average. For example, if your filtered numbers are 1, 2, and 100, the average is 34.33, which is higher than most of the values because of the outlier 100. If you want a measure that is less sensitive to outliers, consider the median instead.
Also, the result depends entirely on your condition. Changing the threshold changes the subset and therefore the average. Always check that the condition matches your intent (e.g., > vs >=).
Common Mistakes and Misconceptions
- Using the wrong operator: >10 excludes 10 itself. If you want to include 10, use >=10.
- Not counting correctly: The denominator is the count of filtered values, not the total count. Forgetting to divide by the smaller n is a common error.
- Mixing up average and median: The average can be skewed by extreme values. If your data has outliers, the median might be more representative.
- Applying filter after averaging: You cannot average first and then filter. The filter must be applied to the individual values before summing and dividing.
- Text or empty cells: In Excel, AVERAGEIF ignores empty cells and text. In this calculator, you should enter only numbers, separated by commas.
Limits of This Formula
This calculator handles a single condition on the same list of numbers. It cannot handle multiple conditions (like >10 and <20) at once, nor can it average values in one column based on a condition in another column (that would be AVERAGEIFS in Excel). For multiple conditions, you would need to filter the list manually first, or use a spreadsheet.
Also, the calculator does not handle text criteria (e.g., average of cells where the corresponding cell says “Yes”). It is purely numeric.
For large datasets, doing this manually is error-prone; a spreadsheet or this calculator is recommended.
Alternatives to a Filtered Average
- Median of filtered values: Gives the middle value, less affected by outliers.
- Trimmed mean: Remove the highest and lowest X% before averaging.
- Weighted average: If some values are more important, assign weights.
- AVERAGEIFS in Excel: For multiple conditions.
- Pivot tables: To quickly filter and average by categories.
Frequently Asked Questions
How is this different from a normal average?
A normal average includes every number in the list. A filtered average only includes numbers that meet a condition. For example, the average of 1, 2, 3, 100 is 26.5, but the average of values >2 is (3+100)/2 = 51.5.
Can I use text conditions like “greater than” on words?
No, this calculator only works with numbers. Text comparisons (like alphabetical order) are not supported. In Excel, you can use text criteria, but the values must be text, and the average would not be numeric.
What does the condition “=10” do?
It keeps only the numbers that are exactly equal to 10. So the average of the filtered list is just 10 (if there is at least one 10). If no numbers equal 10, the result is undefined (division by zero), and the calculator will show an error.
What if no numbers match the condition?
Then there are no values to average, so the result is undefined. In Excel, AVERAGEIF returns #DIV/0! in that case. This calculator will also show an error.
Can I filter by a range like “between 10 and 20”?
Not directly with a single condition. You would need to use two conditions, which this calculator does not support. In Excel, you would use AVERAGEIFS with two criteria: >=10 and <=20.
Is the average affected by the order of numbers?
No, the arithmetic mean is the same regardless of order. The filter condition is applied to each number independently, so the order does not matter.
Related
Formula used
in numbers | Numbers | - | 5, 12, 8, 20, 3, 15 | 0 in condition | Condition | - | >10 | 0 out avg | Average of matching values | - | mean(list_filtered) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.