How do I average only the rows that meet a condition?
AVERAGEIF averages a range where one condition is true: =AVERAGEIF(range, criteria, average_range). AVERAGEIFS extends that to several conditions at once: =AVERAGEIFS(average_range, range1, criteria1, range2, criteria2, ...).
Formula (Excel and Google Sheets)
=AVERAGEIFS(C:C,A:A,"Northeast",B:B,">="&DATE(2026,6,1))AVERAGEIF and AVERAGEIFS work exactly like SUMIF and SUMIFS, but they return an average instead of a total. The example above averages column C, but only for rows where column A is "Northeast" and column B is a date on or after June 1, 2026, ignoring every row that does not match both conditions.
Like SUMIF, AVERAGEIF puts the range to average last (range, criteria, average_range), while AVERAGEIFS puts it first (average_range, range1, criteria1, ...). If you always use AVERAGEIFS, even for a single condition, you only need to remember one argument order.
Step by step
- 1
For one condition, use AVERAGEIF
=AVERAGEIF(condition_range, criteria, average_range). The average_range goes last.
- 2
For more than one condition, use AVERAGEIFS
=AVERAGEIFS(average_range, condition_range1, criteria1, condition_range2, criteria2, ...). The average_range goes first here.
- 3
Confirm the matched rows contain numbers
AVERAGEIF and AVERAGEIFS ignore blank cells in the average range but will error if every matching row is blank or text.
Common questions
What does AVERAGEIFS return if no rows match?
It returns a #DIV/0! error, the same as averaging an empty range, since there is nothing to divide by. Wrap it in IFERROR if you want a cleaner fallback.
Can I use AVERAGEIFS with just one condition?
Yes, and it is a safe default even for a single condition, since the argument order does not change if you add more conditions later.
Related formulas
How to Use SUMIF and SUMIFS in Excel and Google Sheets
RelatedHow to Count Rows That Match Multiple Criteria with COUNTIFS
RelatedHow to Use COUNTIF and COUNTIFS in Excel and Google Sheets
From the blogHow to Make Sense of Your Spreadsheet Data Without Being an Analyst
Want a formula written for your exact spreadsheet, not a generic example?
Try the free formula generator