ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 22 · Conditional sums

SUMIF and AVERAGEIF in Excel

SUMIF adds up only the rows that match. You tell it where to look, what to look for, and which numbers to add. AVERAGEIF works the same way but finds the average.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Add up only the rows that match
  • Fill a whole table with one formula

How it works

SUMIF(range, criteria, sum_range) has three parts:

  • where to look (the Region column)
  • what to look for (East)
  • what to add up (the Amount column)

Point to the region name in column F. Lock the other ranges with $. Then one formula works for every row.

Formulas at a glance

=SUMIF($B$2:$B$9, F2, $C$2:$C$9)check B, add C
=AVERAGEIF(range, criteria, avg_range)The pattern to follow

Example

Write the formula to add up the amounts for the East region (F2).

ABCDEFGH
1OrderRegionAmountStatusRegionTotalAverage
21001West$820.00ShippedEast
31002East$240.00PendingWest
41003North$510.00ShippedNorth
51004West$130.00ShippedSouth
61005South$975.00Pending
71006East$660.00ShippedShipped total
81007West$390.00PendingShipped average

Click G2 and type =SUMIF($B$2:$B$9,F2,$C$2:$C$9), then press Enter.

The answer is $1,205.00.

When to use it

  • Total sales for one region
  • Total spending in one category
  • Average score for one class

Common mistakes

  • Mixing up the three partsWhere to look, what to look for, what to add up.
  • Ranges that don’t line upBoth ranges must start and end on the same rows.
  • Copying down without $Lock the ranges with $ so they stay put.

Quick check

In SUMIF, what does the third part (sum_range) hold?

  1. The cells to check
  2. The numbers to add up
  3. The answer
  4. What to look for
Show the answer

B. The numbers to add up It's the column with the numbers.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

SUMIF and AVERAGEIF in Excel: how it works, with examples · ExcelUnpack