Start free

Working days and due dates: Excel interview question

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

Key takeaways

  • EOMONTH(date, months) gives the last day of a month: 0 for the same month, 1 for the next, -1 for the one before.
  • Adding 30 days isn't "a month": months have 28 to 31 days, and EOMONTH knows which.
  • NETWORKDAYS counts Monday to Friday, both dates included, minus any holidays you list.
  • A due date that lands on a weekend or holiday moves to a working day with WORKDAY.
  • Keep holidays in a range on the sheet, and lock it with $ signs before you copy down.
Jump straight to the practice sheet
On this page

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.

The question

“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.”

What they’re really testing

  • That you know dates are numbers. Subtracting one date from another gives calendar days, and that’s rarely what a business means.
  • That you don’t fake a month. Adding 30 days, or building a date with day 30, breaks on every month that isn’t 30 days long.
  • That you know the working-day functions. NETWORKDAYS to count, WORKDAY to move, both with a holidays range.
  • Edge cases. January to February, a due date on a Sunday, a holiday inside the period.

The worked answer

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:

C2=EOMONTH(B2,1)
RowABCDEF
1InvoiceIssuedDueWorking daysHolidays
2INV-20112 Mar 202630 Apr 2026343 Apr 2026
3INV-20230 Jan 202628 Feb 2026216 Apr 2026
4INV-20320 Apr 202631 May 20262925 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) → 34

INV-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.

Why “+30” is the wrong answer

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:

Wrong=B3+301 Mar 2026
Right=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.

The follow-up: a due date on a weekend

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 2026

That’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.

Common wrong answers, and why they fail

  1. Subtracting the dates. C2-B2 counts every calendar day, weekends included.
  2. Adding 30 days, or using day 30. Wrong for every month that isn’t 30 days long, and February catches it every year.
  3. Forgetting the holidays. NETWORKDAYS without its third argument counts public holidays as working days.
  4. EOMONTH with the wrong month. 0 is the end of the same month, 1 the end of the next one. Read the question twice.
  5. Dates stored as text. A date typed as text, or pasted from another system, may give #VALUE! or sort and filter in the wrong order. Convert it to a real date first; the data cleaning question shows how.

Practise it: working days left in the month

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
RowABCD
1StartWorking daysHolidays
211 May 202625 May 2026
331 Aug 2026
425 Dec 2026

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

Hint

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.

Solution

=NETWORKDAYS(A2,EOMONTH(A2,0),D2:D4) Any formula that returns the same result passes.

How to answer it in the interview

“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.

Practise this in a lessonWorking days in each projectA full exercise in the app's live grid, graded on what your formula calculates.Open the lesson

FAQ

Does the invoice date itself count as a working day?

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.

What if the office works Sunday to Thursday?

Use NETWORKDAYS.INTL and WORKDAY.INTL, which take a weekend code: 7 means Friday and Saturday off.

Why not just add 30 days for "next month"?

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.

What if a holiday falls on a weekend?

NETWORKDAYS doesn't take it off twice: a Saturday holiday was never a working day, so the count doesn't change.

Summarize this guide withChatGPTPerplexityClaude

Keep going

Guides that build on this one.

All guides
Interview prepPractice sheet

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.

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
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

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