Skip to main content
Albero Academy

SUMIF & COUNTIF

Aggregate only the rows that meet a condition.

Lookup & Reference8 min

Often you want a total or count of only some rows — sales for one region, students who passed. The *IF functions aggregate with a built-in condition.

SUMIF / COUNTIF / AVERAGEIF

one condition
=SUMIF(B2:B100, "Data", C2:C100) sum C where B = "Data"
=COUNTIF(B2:B100, "Pass") count cells equal to "Pass"
=COUNTIF(B2:B100, ">= 40") count with a comparison
=AVERAGEIF(B2:B100, "Data", C2:C100) average C where B = "Data"

Multiple conditions: *IFS

SUMIFS / COUNTIFS
=SUMIFS(C2:C100, B2:B100, "Data", D2:D100, ">7")
│ │ │ │ └ 2nd condition
│ │ │ └ 2nd criteria range
│ └ 1st criteria range + criterion
└ the range to SUM (note: comes FIRST in SUMIFS)

Key takeaways

  1. 01SUMIF/COUNTIF/AVERAGEIF aggregate only rows meeting one condition.
  2. 02Criteria can be text ("Data") or comparisons (">=40").
  3. 03SUMIFS/COUNTIFS/AVERAGEIFS handle multiple conditions.
  4. 04Argument order differs: SUMIF puts the sum range last, SUMIFS puts it first.

Finished this chapter?

Mark it complete to track your progress through Excel.