Excel Supreme

Excel track · Exercise 3 of 86 Paid

SUMIF: a sum range on another column

Total one column while testing a different column for the condition.

Intermediate

Regional amounts and bonuses, and a list of scores

Read-only data · screen 1 of 2 · answer in C7

In C7, total the North bonus from column C, testing the region in column A.

ABC
1RegionAmountBonus
2North32032
3South25025
4North18018
5West30030
6North40040
7North bonus

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

C7

What it does

SUMIF's third argument is the range to add. Leave it out and SUMIF adds the cells it has just tested, which suits a column of scores and fails the moment the numbers sit somewhere else.

Column A holds the region and column C the bonus, so the condition reads A2:A6 while the addition reads C2:C6. The ranges only have to line up row for row: row 2 of each is the same sale, and the North bonuses of 32, 18 and 40 come to 90.

A shifted range gives a wrong total instead of an error, so check that both ranges start and end on the same rows. The second screen works with two arguments because there the scores are both the test and the total.

Syntax

=SUMIF(criteria_range, condition, [sum_range])

Worked example

On Regional amounts and bonuses, and a list of scores, =SUMIF(A2:A6,"North",C2:C6) returns 90.

=SUMIF(A2:A6,"North",C2:C6)

Common errors

Error codes for SUMIF with a separate sum range, and a comparison condition with no sum range
ErrorWhat it means and how to fix it
#VALUE!The sum range holds text where numbers were expected, which happens when the region column is given as the third argument.
#NAME?The function is spelled SMIF, or SUMIFS was used with the argument order SUMIF keeps.
Silent 0Two arguments means SUMIF adds the criteria range. With words in that column the answer is 0, and no error marks it.

At work

A commission sheet where the region decides who is paid and the bonus column carries the money.