Total sales for one region (SUMIF)

Medium Math
Description
Hints 0/4
Solutions 2
–
Test case
1
2
3
Reset
Submit
fx
A
B
C
D
E
F
G
1
2
3
4
5
6
7
8
9
10
Loading interactive spreadsheet...
Preparing grid cells and formula calculation engine
○ Ready Enter formula in highlighted cells, then click Submit.

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)
The exercise data, as a table
ABDE
1 RegionSalesRegionTotal sales
2 North450North
3 South320
4 North610
5 East280
6 North520
7 South390

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.

  1. Target cell is E2
  2. The criteria range is A2:A7 (regions) and the sum range is B2:B7 (sales)
  3. Criteria should reference D2 so the formula works for any region
  4. 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

Related practice

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").