Fix SUMIF: right criteria, wrong sum range
Diagnose before you fix
The problem
Problem statement
The North total in Total cell F2 is a number — just not the right one. The formula is already there. Diagnose why SUMIF quietly totals the wrong column and repair it.
Keep the same criteria range and criterion; only the sum range is wrong.
Problem data
Show the sheet as a table (selectable, copyable)
| A | B | C | E | F | |
|---|---|---|---|---|---|
| 1 | Region | Units | Target | Region | Total units |
| 2 | North | 12 | 50 | North | |
| 3 | South | 20 | 60 | ||
| 4 | North | 15 | 70 | ||
| 5 | West | 8 | 80 | ||
| 6 | North | 10 | 90 |
Notes
SUMIF never complains when the sum range is the wrong column: it happily adds numbers that happen to sit there. The third argument must be the column you actually want to total — Units in B, not Target in C. A plausible wrong answer is more dangerous than an error.
How to approach
Your answer goes in F2. 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 F2 — the result looks reasonable but is wrong
- Compare the first and third arguments of the
SUMIFalready in F2 - The criterion is correct; only the column being added is wrong
- Shape:
=SUMIF(?, ?, B2:B6)
Official solutions
Show 2 solutions — try it yourself first
Approach 1: locked sum range
=SUMIF($A$2:$A$6,$E$2,$B$2:$B$6)
The criteria column is A, the criterion is E2, and the sum column is now Units (B): 12 + 15 + 10 = 37. C held targets and produced a believable but meaningless 210.
Approach 2: relative ranges
=SUMIF(A2:A6,E2,B2:B6)
The same repair without $ — fine for a single cell. Locking the ranges is safer if the formula will be copied.
Function guide
FAQ
Why does SUMIF give a wrong number instead of an error?
Because the third argument is still a valid range. SUMIF adds whatever numbers are in it, so pointing it at the wrong column produces a plausible but meaningless total.
How do I spot this in a real report?
Check that the criteria range and the sum range have the same shape and describe the same rows, and sanity-check the total against the source column.