SUMIFS interview question: summarise sales by region
Turn a raw sales list into a summary by region and product, without a pivot table. The formula interviewers expect, the $ signs that make it copy, and a sheet that grades yours.
Use =EOMONTH(B2,1) for “due at the end of next month” and =NETWORKDAYS(B2,C2,holidays) for the working days in between. EOMONTH jumps to the last day of a month, however long that month is, and NETWORKDAYS counts Monday to Friday with both dates included, minus the holidays you list. If a due date lands on a weekend, =WORKDAY(C2+1,-1,holidays) moves it back to the last working day.
“Our invoices are due on the last day of the month after they’re issued. For each invoice, give me the due date and the number of working days the client has to pay. Leave out our office holidays.”
Sometimes it comes with a twist: “and if the due date falls on a weekend, make it the Friday before.”
Invoices are in A1:D4 and the office holidays in F2:F4. The due date in C2 is the end of the month after the issue date, which is what EOMONTH gives:
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Invoice | Issued | Due | Working days | Holidays | |
| 2 | INV-201 | 12 Mar 2026 | 30 Apr 2026 | 34 | 3 Apr 2026 | |
| 3 | INV-202 | 30 Jan 2026 | 28 Feb 2026 | 21 | 6 Apr 2026 | |
| 4 | INV-203 | 20 Apr 2026 | 31 May 2026 | 29 | 25 May 2026 |
INV-202 shows why EOMONTH matters: issued on 30 January, due on 28 February, because that’s the last day of February 2026. The working days in D2 are NETWORKDAYS from the issue date to the due date, leaving out the holidays:
=NETWORKDAYS(B2,C2,$F$2:$F$4) → 34INV-201 has 34 working days, with Good Friday and Easter Monday (3 and 6 April) taken off. The $ signs keep the holidays range fixed when you copy the formula down.
The quickest answer, and the one interviewers expect a weak candidate to give, is to add 30 days. For INV-202 it lands on 1 March, a day after the real due date:
=B3+301 Mar 2026=EOMONTH(B3,1)28 Feb 2026=DATE(YEAR(B3),MONTH(B3)+2,0) is a correct alternative with DATE: day 0 of a month is the last day of the month before. EOMONTH says what it means, so it’s the one to write.
INV-203’s due date is 31 May 2026, a Sunday, and INV-202’s, 28 February, is a Saturday. To move INV-203’s back to the last working day of May, start one day after the due date and go one working day back with WORKDAY:
=WORKDAY(C4+1,-1,$F$2:$F$4) → 29 May 2026That’s Friday 29 May. Starting from the day after matters: a due date that’s already a working day stays where it is, because one working day back from the next day is the due date itself.
C2-B2 counts every calendar day, weekends included.A different task on new dates: the end of the start date’s own month, not the next one. We check your count, then move the start date to other months, with and without a holiday in them.
Your task: In B2, count the working days from the date in A2 to the last day of its month, both days included, leaving out the holidays in D2:D4.
Graded live| Row | A | B | C | D |
|---|---|---|---|---|
| 1 | Start | Working days | Holidays | |
| 2 | 11 May 2026 | 25 May 2026 | ||
| 3 | 31 Aug 2026 | |||
| 4 | 25 Dec 2026 |
Write the formula in the bar above, then press Check or Enter.
EOMONTH(A2,0) is the last day of A2's month. Count from A2 to it with NETWORKDAYS, and give it the holidays, D2:D4, as the third argument.
=NETWORKDAYS(A2,EOMONTH(A2,0),D2:D4) Any formula that returns the same result passes.
“Due date is EOMONTH of the issue date plus one month, so month lengths are handled. Working days are NETWORKDAYS from issue to due, with the holidays range locked. If a due date can’t be on a weekend, WORKDAY from the next day, one day back.” Mention that NETWORKDAYS counts both ends: it’s the detail interviewers check. More questions like this one: Excel interview questions.
With NETWORKDAYS, yes: both dates count when they're working days. From a Monday to the Friday of the same week is 5, not 4. If the client's time starts the day after the invoice, count from B2+1.
Use NETWORKDAYS.INTL and WORKDAY.INTL, which take a weekend code: 7 means Friday and Saturday off.
Because months aren't 30 days long. An invoice from 30 January 2026 plus 30 days lands on 1 March, skipping February's end entirely.
NETWORKDAYS doesn't take it off twice: a Saturday holiday was never a working day, so the count doesn't change.
Guides that build on this one.
Turn a raw sales list into a summary by region and product, without a pivot table. The formula interviewers expect, the $ signs that make it copy, and a sheet that grades yours.
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.
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.
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