SUM answers "how much in total". Most real questions are narrower than that: how much did the North region sell, how much came from orders over 1,000, how much came from Ada in the North. You can answer them by filtering, copying the visible rows somewhere else, and summing those — but the answer goes stale the moment the data changes, and the sum lives in the wrong place.

SUMIF answers the same question with one formula that stays live. You name a column to test, a condition to test it against, and a column to add. By the end of this tutorial you will have written one, seen exactly how Excel pairs up the two columns behind the scenes, learned how criteria like ">1000" and "A*" are read, and fixed a total that comes back as 0 instead of the number you expected.

What you need: any version of Excel, including Excel for the web. You should already know that B2:B9 is a range and that formulas point at cells by address — if that is shaky, read cells, formulas and cell references first.

Type this table into a blank sheet, starting in A1:

OrderRegionRepAmount
1001NorthAda1200
1002SouthBen800
1003NorthCara1500
1004EastDev400
1005NorthAda950
1006SouthCara2000
1007EastBen300
1008NorthDev1100

The order column is decoration; the other three span rows 2 to 9.

Step 1: How to use SUMIF in Excel

In F1 type North, and in G1 enter:

1=SUMIF(B2:B9,"North",D2:D9)

G1 shows 4750 — 1200 + 1500 + 950 + 1100. The rows from South and East contribute nothing, but they are never removed; they are simply not added.

The formula has three arguments:

  • range — the cells to test: B2:B9, the Region column.
  • criteria — what a cell in that range must satisfy: "North".
  • sum_range — the cells to add when a test passes: D2:D9, the Amount column.

Excel walks down B2:B9 one cell at a time. Each time the cell says North, it takes the corresponding cell in D2:D9 and adds it. When the third argument is left out, the tested range is also the one that gets added — which is why =SUMIF(D2:D9,">1000") returns 5800: it tests the amounts and adds the ones over 1000. That shorthand is correct only when the condition and the numbers live in the same column.

A SUMIF formula with its three arguments labelled: the range being tested, the criteria, and the sum_range being added

Step 2: The two ranges are paired by position, not by size

The two ranges cannot be matched by value — one holds text, the other numbers. What actually ties them together is row position: the first cell of range pairs with the first cell of sum_range, the second with the second, and so on.

That has a consequence worth remembering, because it explains a whole family of silently wrong totals. Excel reads only the top-left cell of sum_range and then grabs a block the same size and shape as range 1. So if range is 8 rows tall, the summed block is 8 rows tall starting wherever you pointed it, even if you typed something different. Pointing at D2:D9 and at D2:D100 gives the same answer here.

The danger is the offset. Write =SUMIF(B2:B9,"North",D3:D9) and you have not summed D3:D9. Excel starts at D3 and extends downward for 8 rows, taking in D3:D10, then pairs those cells with B2:B9 one row too low. The formula still returns a number, and it is quietly wrong. Both ranges must start on the same row.

Step 3: How criteria are actually evaluated

The criteria argument is the part people get stuck on, because it does not hold a value — it holds a rule. Excel's rules:

  • Text must be in double quotes. "North" works, bare North gives #NAME?.
  • Numbers do not need quotes. 1000 is fine, though "1000" also works.
  • Operators must live inside the quotes. Greater than 1000 is ">1000" — a single string, because the operator and the number are one rule. The whole criteria argument is case-insensitive, so "north" matches North too.
  • A cell reference is passed bare. If F1 holds North, the criteria is F1, with no quotes. Typing "F1" compares every region against the literal four characters F–1, matches nothing, and returns 0.
  • To combine an operator with a cell reference, glue them with &. Put 1000 in F2 and write =SUMIF(D2:D9,">"&F2) to get a threshold you can change without editing the formula.

Wildcards turn criteria into partial matches. * stands for any run of characters and ? for exactly one, so "A*" matches any rep whose name starts with A, "*a" matches any name ending in a, and "*ar*" matches any name containing ar 4. =SUMIF(C2:C9,"A*",D2:D9) returns 2150 (Ada's two orders), while =SUMIF(C2:C9,"*ar*",D2:D9) returns 3500 (Cara's).

Step 4: Adding a second condition with SUMIFS

SUMIF tests exactly one thing. For two conditions at once you use SUMIFS, which takes pairs of range-and-criteria:

1=SUMIFS(D2:D9,B2:B9,"North",C2:C9,"Dev")

That returns 1100 — the single order that is both North and Dev.

Notice what moved: the sum range is now the first argument, and the tested ranges follow in pairs 2. This is the single most common SUMIF mistake, because the two functions look almost identical and the arguments are in a different order. If you copy a SUMIF and add a condition, you must move the amount column to the front.

SUMIFS combines conditions with AND: a row must satisfy every pair. There is no argument for OR. To add rows that are in either of two regions, add two SUMIFs together — =SUMIF(B2:B9,"North",D2:D9)+SUMIF(B2:B9,"East",D2:D9).

Why your SUMIF returns 0

This is the most common search that follows a SUMIF tutorial, and there are only a few causes worth checking, in this order:

  1. The numbers are stored as text. If the Amount column was pasted from another system, the values may be left-aligned with a green warning triangle. SUMIF adds numbers and skips text, so it returns 0. Diagnostic: put plain =SUM(D2:D9) next to it. If that is also 0, the problem is the data, not the criteria — convert the column to numbers.
  2. The criteria points at the wrong cell. A quoted cell reference ("F2" instead of F2) compares against the literal text F2, and a reference to an empty cell turns ">"&F2 into a bare ">", which matches nothing.
  3. The labels do not match exactly. SUMIF does not trim spaces, so a Region stored as "North " with a trailing space will not match "North". This is the same invisible-difference problem that makes duplicate rows survive a cleanup pass.
  4. The sum range is offset. If steps 1–3 are clean, check that range and sum_range start on the same row, per Step 2.

The order matters: a total of 0 almost always means no row matched, or the matching rows held no numbers. A total that is merely too small or too large usually means a misalignment.

The same pattern with COUNTIF

Once the criteria grammar is familiar, the counting version costs nothing extra. =COUNTIF(B2:B9,"North") returns 4, the number of North rows, and =COUNTIFS(B2:B9,"North",C2:C9,"Ada") returns 2. COUNTIF has only two arguments — range and criteria — because there is nothing to add. Everything from Step 3 about quotes, operators, cell references and wildcards applies unchanged 5.

Want rows selected rather than summed? That is what the IF function is for: same kind of test, but it returns one of two results instead of adding a column.

What SUMIF cannot do

Two limits are worth knowing so you do not chase them. SUMIF gives wrong results when the criteria has to match a text string longer than 255 characters, or the literal string #VALUE! 1 — rare, but real when you match against pasted comment fields. And because SUMIF recalculates against fixed ranges, a formula pointed at B2:B9 will not see row 10 when you add it; if the data grows, either extend the range or convert it to an Excel Table so the reference grows with it.