# SUMPRODUCT (Excel lesson 35 of 45)

> Multiply row by row and add it up, in one cell.

Source: https://spreadsheetpractice.com/learn/sumproduct · Updated October 29, 2026

- **Course:** [Excel course](https://spreadsheetpractice.com/learn), track "Analysis"
- **Time:** about 9 minutes, 3 graded exercises
- **Functions:** `SUMPRODUCT`
- **Access:** Pro (the lesson text is free; the graded exercises need Pro)
- **Key formula:** `=SUMPRODUCT(B2:B7,C2:C7)`: Total revenue

## How it works

`SUMPRODUCT(B2:B7,C2:C7)` multiplies units by price on every row and adds the results: total revenue with no helper column.

Multiply in a condition like `(D2:D7="Hardware")` and its TRUE/FALSE values become 1s and 0s that switch rows on and off. Divide by SUM of the weights for a weighted average.

## Syntax

| Formula | What it does |
|---|---|
| `=SUMPRODUCT(B2:B7,C2:C7)` | Total revenue |
| `=SUMPRODUCT(B2:B7,C2:C7)/SUM(B2:B7)` | Weighted average price |
| `=SUMPRODUCT((D2:D7="Hardware")*B2:B7*C2:C7)` | Revenue for one category |

## Watch out for

- TRUE/FALSE only become 1/0 when you do math on them, so multiply the condition by a range.
- All ranges must be the same size.

## The exercises

Solve them in the live grid at [SUMPRODUCT](https://spreadsheetpractice.com/learn/sumproduct). Each answer is graded, then re-checked on changed data so typed-in numbers don't pass.

1. **Total revenue.** In G2, calculate total revenue (units × price for every row) in one formula.
2. **Weighted average price.** In G3, calculate the average price per unit sold: total revenue divided by total units.
3. **Revenue for one category.** In G4, calculate revenue for the Hardware category only, using SUMPRODUCT.

Previous: [RANK, LARGE & SMALL](https://spreadsheetpractice.com/learn/rank-large-small) · Next: [Running totals & share of total](https://spreadsheetpractice.com/learn/running-totals-share-of-total)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
