Intermediate · Lesson 6 of 12

Adding and counting by category

SUMIF adds matching rows

Tell it which column to check, what to look for, and which column to add.

=SUMIF(A2:A6,E2,B2:B6)

COUNTIF counts matching rows

It works the same way, but it only needs the column to check and what to look for.

=COUNTIF(A2:A6,E2)

Two or more conditions

SUMIFS and COUNTIFS accept as many pairs of column and condition as you need. In SUMIFS, the column to add comes first.

=SUMIFS(C2:C5,A2:A5,F1,B2:B5,F2)

Conditions with numbers

Put a test in quotes, such as ">100". To use a number from a cell, join it with &.

=COUNTIF(B2:B6,">"&E1)

Try the practice problems for this lesson

Next lesson: Looking things up