Excel Supreme

Excel track · Exercise 29 of 86

SUMIF: total one region

Total only the rows that match a region.

Intermediate

Regional sales

Read-only data · answer in B7

In B7, total the North amounts from the sales table in A1:B6.

AB
1RegionAmount
2North320
3South250
4North180
5West300
6North400
7North total

Download this grid (.xlsx) Two tabs: the grid you see, and the answer.

B7

What it does

SUMIF asks two things at once: which rows match, and which column gets added. The regions sit in A2:A6, the condition is North, and the amounts sit in B2:B6.

=SUMIF(A2:A6,"North",B2:B6) returns 900 from the three North rows of 320, 180 and 400, while the table holds 1450. The third argument is the one people drop, and dropping it makes SUMIF add the region names instead, which comes back as 0.

Conditions behave as they do in COUNTIF, so ">=200" and "N*" both work. The two ranges are matched by position, so give them the same shape.

Syntax

=SUMIF(range, criteria, [sum_range])

Worked example

On Regional sales, =SUMIF(A2:A6,"North",B2:B6) returns 900.

=SUMIF(A2:A6,"North",B2:B6)

Common errors

Error codes for SUMIF
ErrorWhat it means and how to fix it
#VALUE!The sum range and the criteria range are different shapes, so the rows no longer line up.
#NAME?The function is misspelled, or SUMIFS was used with the argument order SUMIF keeps.
Wrong totalLeaving out the sum range makes SUMIF add the region names. The answer is 0 and Excel reports nothing.

At work

A flat export turned into a summary by category, without a pivot table.