Total sales for one region (SUMIF)
The problem
Problem statement
The quarterly ledger in A2:B7 mixes four regions into one running list. Regional review is tomorrow and the North team wants their number, not the company total. Put the North-region sales total in the Total sales cell E2, driven by the region name in D2.
Take the criterion from D2 and lock the ranges — case 3 shuffles the rows, so positions must not be assumed.
Problem data
Show the sheet as a table (selectable, copyable)
| A | B | D | E | |
|---|---|---|---|---|
| 1 | Region | Sales | Region | Total sales |
| 2 | North | 450 | North | |
| 3 | South | 320 | ||
| 4 | North | 610 | ||
| 5 | East | 280 | ||
| 6 | North | 520 | ||
| 7 | South | 390 |
Notes
SUMIF(range, criteria, sum_range) checks the region column and adds only the matching sales cells. Pointing criteria at D2 instead of hardcoding "North" makes the same formula reusable for every region.
How to approach
Your answer goes in E2. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.
- Target cell is E2
- The criteria range is A2:A7 (regions) and the sum range is B2:B7 (sales)
- Criteria should reference D2 so the formula works for any region
- Pattern:
=SUMIF(criteria_range, criteria, sum_range)
Official solutions
Show 2 solutions — try it yourself first
Approach 1: SUMIF keyed off the region cell
=SUMIF(A2:A7, D2, B2:B7)
SUMIF scans A2:A7 for the region in D2 and adds the matching cells from B2:B7. Change D2 to South and the same formula returns the South total.
Approach 2: SUMIF with hardcoded criteria
=SUMIF(A2:A7, "North", B2:B7)
Same result, but the region is frozen inside the formula. Quick for a one-off report; the D2 version scales better when you report several regions.
Function guide
FAQ
How do I sum only rows that match a condition?
Use =SUMIF(A2:A7, D2, B2:B7): the first range is tested against the criteria, and only matching rows contribute their B-column values to the total.
Why reference D2 instead of typing "North"?
A criteria cell makes the formula reusable — switch D2 to any region and the total follows, no formula editing needed. It also survives test cases that change the region.
What is the difference between SUMIF and SUMIFS?
SUMIF applies one condition. SUMIFS handles multiple conditions at once and puts the sum range first: =SUMIFS(B2:B7, A2:A7, "North", C2:C7, ">1000").