Totals and counts function

AVERAGEIF

Average the matching rows.

Purpose

Average the rows that meet one condition

Returns

The average of the matching rows

Syntax

=AVERAGEIF(range, condition, [average_range])

ArgumentRequiredWhat goes here
rangeRequiredThe column to test.
conditionRequiredWhat that column has to match.
average_rangeOptionalThe column of amounts to average.

How to use AVERAGEIF

AVERAGEIF is SUMIF divided by COUNTIF, in one formula and with the same argument order: test first, average last.

It only averages the rows that matched. Rows that failed the condition are not counted as nought, they are not there at all.

That is the distinction to be careful about. Average days overdue across only the overdue rows is a different number from average days overdue across the ledger, and both are defensible as long as the label says which one it is.

Examples

Every result below is worked out by the same evaluator that marks your answers, on the sheet shown here.

Payables ageing — October.xlsxSheet1
Harbour Foods payables at 31 October 2026, with supplier terms alongside
ABCDEFGH
1InvoiceSupplierStatusDays overdueAmountSupplierTerms (days)
2INV-8801Brightwell PaperOverdue12940Ashgrove Catering30
3INV-8802Calder UtilitiesQueried471180Brightwell Paper30
4INV-8803Meridian FreightOverdue632450Calder Utilities14
5INV-8804Ashgrove CateringOn terms0405Meridian Freight45
6INV-8805Brightwell PaperOverdue38760Thornbury Print60
7INV-8806Thornbury PrintOverdue911320
8INV-8807Meridian FreightOn terms0580
9INV-8808Calder UtilitiesOverdue24215
FormulaResult
=AVERAGEIF(C2:C9,"Overdue",E2:E9)The typical overdue invoice.1137
=ROUND(AVERAGEIF(D2:D9,">0",D2:D9),1)Average age of the debts that are actually overdue, leaving the current ones out.45.8
=ROUND(AVERAGE(D2:D9),1)The same column averaged across every row. Lower, because the rows that are not overdue drag it down, and both figures are true.34.4

Notes

  • An AVERAGEIF that matches nothing gives an error rather than nought.
  • Say in the label which population was averaged. The two answers differ and neither is wrong.