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

Lesson 70 · Array formulas

SUMPRODUCT with conditions in Excel

SUMPRODUCT can add only the rows that pass a test. (B2:B9="West") gives TRUE or FALSE for each row, and multiplying turns those into 1 and 0, so only West rows are added.

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

What you will learn

  • Turn a test into 1s and 0s
  • Add only matching rows with SUMPRODUCT

How it works

(B2:B9="West") checks every row. When you multiply, TRUE counts as 1 and FALSE as 0.

=SUMPRODUCT((B2:B9="West")*C2:C9) adds only the West amounts.

Formulas at a glance

=SUMPRODUCT((B2:B9="West")*C2:C9)one condition
=SUMPRODUCT((B2:B9="East")*(D2:D9="Shipped")*C2:C9)two

Example

Write the formula with SUMPRODUCT to add up the West amounts.

ABCDEF
1OrderRegionAmountStatus
21001West$820.00ShippedWest total
31002East$240.00PendingEast shipped
41003North$510.00Shipped
51004West$130.00ShippedNorth total
61005South$975.00PendingWest pending
71006East$660.00Shipped
81007West$390.00Pending

Click G2 and type =SUMPRODUCT((B2:B9="West")*C2:C9), then press Enter.

The answer is $1,340.00.

When to use it

  • Totals with conditions in any version of Excel
  • Totals with tests SUMIFS can’t do
  • Adding rows that match two or more tests

Common mistakes

  • Ranges of different sizesEvery range must cover the same rows.
  • Forgetting the parentheses around testsEach test needs its own ( ).
  • Using commas between testsMultiply the tests with * so they work as AND.

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.

SUMPRODUCT with conditions in Excel: how it works, with examples · ExcelUnpack