Start free

SUMIFS interview question: summarise sales by region

Works in Excel 2007 and later, Excel for the web and Google Sheets

Key takeaways

  • SUMIFS puts the range to add first, then a range and a criterion for each condition. SUMIF puts it last.
  • For a grid, lock the data ranges ($D$2:$D$9), the row label's column ($F2) and the column label's row (G$1), then copy one formula everywhere.
  • Point criteria at cells, not typed text, so the summary follows its labels.
  • Check your summary: the grid's total should equal the total of the raw data.
  • COUNTIFS takes the same pairs without a sum range, and counts the rows instead.
Jump straight to the practice sheet
On this page

Answer it with one SUMIFS formula, written once and copied across the whole summary: =SUMIFS($D$2:$D$9,$A$2:$A$9,$F2,$B$2:$B$9,G$1). It adds the amounts in D for the rows whose region matches the label on its row and whose product matches the label above its column. The $ signs are the real test: they decide whether the formula still points at the right labels after you copy it.

The question

“This is last month’s sales export: one row per deal. Build me a summary with regions down the side and products across the top, showing total sales in each box. No pivot tables, please: I want to see the formulas.”

Variations include “how many deals over 1,000 did each region close” (COUNTIFS) or “total sales for the region I pick from a list” (SUMIFS pointed at a cell).

What they’re really testing

  • SUMIFS’s argument order. The range to add comes first, then a range and a criterion for each condition.
  • Mixed references. One formula that copies correctly across a grid, instead of a different formula typed into each box.
  • Criteria from cells. The labels on the sheet drive the formula, so changing a label changes the total.
  • That you check your work. A summary whose total doesn’t match the raw data has a hole in it.

The worked answer

The deals are in A1:D9 and the summary grid in F1:H4. The formula in G2 is copied to every box:

G2=SUMIFS($D$2:$D$9,$A$2:$A$9,$F2,$B$2:$B$9,G$1)
RowABCDEFGH
1RegionProductRepAmountLaptopMonitor
2NorthLaptopKim1,200North2,100450
3SouthMonitorRaj300South1,100800
4NorthMonitorKim450West1,350250
5WestLaptopAde1,350
6SouthLaptopRaj1,100
7NorthLaptopLu900
8WestMonitorAde250
9SouthMonitorLu500

Read it as “add up D2:D9 where the region is the label in this row’s column F, and the product is the label in this column’s row 1”. The $ signs do the rest:

Reference Locked When copied across When copied down
$D$2:$D$9, $A$2:$A$9, $B$2:$B$9 Column and row Stays Stays
$F2 Column only Stays on F Moves to F3, F4
G$1 Row only Moves to H1 Stays on row 1

Then prove it. The six boxes should add up to the same total as the raw amounts. Say this out loud in the interview: it’s what a careful analyst does before sending anything.

=SUM(G2:H4)-SUM(D2:D9) → 0

A difference of 0 means every deal landed in exactly one box. A negative number means a region or product is missing from the labels, or spelt differently in the data; a positive one means a label appears twice in the grid.

The $ signs, and what happens without them

Write =SUMIFS(D2:D9,A2:A9,F2,B2:B9,G1) in G2 and it’s right in that one box. Copy it to H3 and every reference moves one row down and one column right: the amounts become E3:E10, an empty column, the region G3, a number, and the product H2, another number. Nothing matches, so the box shows 0 instead of South’s monitor sales:

Wrong=SUMIFS(E3:E10,B3:B10,G3,C3:C10,H2)0
Right=SUMIFS($D$2:$D$9,$A$2:$A$9,$F3,$B$2:$B$9,H$1)800

Zero is a believable number in a sales report, which is why this mistake survives until someone checks the total.

The COUNTIFS version

“How many deals over 1,000?” is COUNTIFS: the same pairs of range and criterion, without a range to add:

=COUNTIFS(D2:D9,">1000") → 3

Add a pair for each extra condition, such as the region: =COUNTIFS($A$2:$A$9,$F2,$D$2:$D$9,">1000"). The comparison goes in quotes. To compare with a number in a cell, join them: ">"&J1.

Common wrong answers, and why they fail

  1. SUMIF’s order inside SUMIFS. SUMIF puts the range to add last, SUMIFS first. Mixing them up adds the wrong column or returns an error.
  2. One condition only. SUMIF on the region totals every product in it. Each condition needs its own pair.
  3. Typed criteria. "North" inside the formula works in one box and stops following the labels.
  4. Missing $ signs. Right in the first box, wrong or 0 everywhere it’s copied.
  5. COUNTIFS when they asked for a total. It counts the deals instead of adding their amounts.
  6. Ranges of different sizes. Every range in SUMIFS must have the same number of rows, or it returns #VALUE!.

Practise it: total one region and one product

A smaller table with the region and product typed into cells, so the grid formula above won’t fit. We check your total, then change the region, the product and one of the amounts.

Your task: In F3, total the amounts for the region in F1 and the product in F2.

Graded live
RowABCDEF
1RegionProductAmountRegionEast
2EastChairs420ProductDesks
3WestDesks980Total
4EastDesks760
5EastDesks1,150
6WestChairs300
7NorthDesks640
8EastChairs210

Write the formula in the bar above, then press Check or Enter.

Hint

SUMIFS takes the range to add first (C2:C8), then pairs: the regions with F1, and the products with F2.

Solution

=SUMIFS(C2:C8,A2:A8,F1,B2:B8,F2) Any formula that returns the same result passes.

If they ask about SUMPRODUCT

SUMPRODUCT can do the same with arrays, and handles conditions SUMIFS can’t, such as a test on the month of a date. For a plain summary by labels, SUMIFS is easier to read and to check. See SUMPRODUCT for when it’s the better tool.

How to answer it in the interview

“One SUMIFS, written in the first box and copied across the grid: the amounts first, then the regions against the row label and the products against the column label, with the data ranges locked and the labels half-locked. Then I check that the grid adds up to the raw total.” More questions like this one: Excel interview questions.

Practise this in a lessonTotal with two conditionsA full exercise in the app's live grid, graded on what your formula calculates.Open the lesson

FAQ

Why use SUMIFS when a pivot table can do the same?

A pivot table needs refreshing and has its own layout. SUMIFS updates the moment the data changes and fits any layout a report needs. Interviewers often ask for both, so mention that you'd choose by what the report is for.

What if the interviewer asks for SUMIF instead?

SUMIF handles one condition and takes the range to add last: =SUMIF(A2:A9,"North",D2:D9). For region and product together you need SUMIFS, so say so and show both.

How do I total amounts above a value with SUMIFS?

Put the comparison in quotes as the criterion: =SUMIFS(D2:D9,D2:D9,">1000"). To compare with a cell, join them: ">"&H1.

Is SUMIFS case-sensitive?

No. "north" and "North" match the same rows.

Summarize this guide withChatGPTPerplexityClaude

Keep going

Guides that build on this one.

All guides
Interview prepPractice sheet

Excel lookup interview question: match two tables

The lookup task almost every Excel interview includes: bring a value across from a second table. The answer interviewers want, why VLOOKUP fails here, and a sheet that grades yours.

4 min read · Updated
Interview prepPractice sheet

FILTER, UNIQUE and SORT: an Excel interview question

List each customer once, A to Z, for the region someone picks, in one formula that updates itself. The dynamic-array answer interviewers look for, and a sheet that grades yours.

4 min read · Updated
Interview prepPractice sheet

Excel data cleaning interview question

Extra spaces, names in the wrong order, numbers stored as text and dates that aren't dates: the cleaning task interviewers love, solved with formulas, and a sheet that grades yours.

4 min read · Updated

Reading is step one. Writing the formula is the skill.

Practise in a live grid that grades what your formula calculates, with a specific hint when it's wrong.

Runs in your browser · Graded on your result · No install