Ravindra BagaleCourses & study guides मराठी Track your progress

3. Formulas and Functions

Excel

3.11 Working Days, DATEDIF and WEEKDAY

Count working days and build dependable deadlines

A partner store logs a support request on Friday. Its team promises a response two working days later. The team does not work on Saturdays or Sundays and will also be closed on Monday. Adding 2 to the Friday date gives Sunday. Counting two working days skips three closed dates and gives Wednesday. Before writing the formula you need the promised unit, the weekend pattern and the actual closure dates.

This lesson uses a fictional quick-commerce support desk inspired by familiar delivery apps such as Blinkit and Amazon Now. Closures and service promises are invented for practice. You will calculate a deadline, count open days in a reporting interval, label the weekday and compare elapsed days with completed years. The two labs use fixed values so you can check the answers on any day.

  • Find a date. WORKDAY answers “when will two working days have passed?”
  • Count eligible dates. NETWORKDAYS answers “how many working dates are inside this start-to-end window?”
  • Name the weekday. WEEKDAY gives the position of a date in the week according to the numbering scheme selected.
  • Measure tenure. DATEDIF can count complete years or months across ordinary dates. A day difference also works by subtraction.

Turn a deadline promise into a calendar rule

Calendar days include every date. If a question asks for two calendar days after Friday, take the Friday date and add two. Working days are the dates an explicit rule treats as open. Many office calendars exclude Saturday and Sunday. A branch can instead close Friday and Saturday, or have a six-day week. Additional closure dates can remove days that would otherwise count.

Decide how to count the starting date

To find a deadline a positive number of working days after opening a request, begin counting from the dates that follow the start. If the request opened on a working Friday, Monday would normally be the first following working day when Saturday and Sunday are closed. Adding a Monday closure moves that first day to Tuesday. If the business instead counts the opening date as the first day when it is open, the policy is different. Test the exact starting-date case rather than assuming the same calculator represents both.

Time-of-day rules can also change the effective start. A team might agree that requests received after 5 p.m. enter the next working day's queue. Build or obtain the effective start date before calculating a two-day service promise. WORKDAY counts whole working dates from the supplied start. An hourly operating schedule, different timezones and cut-off exceptions require their own source rules.

Write down enough policy for someone else to check it

  • Responsible team. Identify the team or branch that sets the service calendar. The customer and support team can be in different places.
  • Weekend pattern. Check which weekdays are closed in the relevant period. A calendar that changes halfway through an interval may need separately modelled periods or a table of open dates.
  • Closure list. Store real numeric dates in one place. Use only confirmed closures for that team and period. Keep a source note when replacing a practice list with an operational calendar.
  • Start rule. Say whether the opening date counts and how changes to the effective start are handled.
Can two support teams calculate different due dates for the same request?

Yes. Different weekend patterns or closure dates produce different eligible dates. A dependable workbook specifies whose calendar applies before choosing a formula. Comparing outcomes across teams without documenting their calendars can make a valid difference look like a formula error.

Use WORKDAY when the answer is a date

=WORKDAY(start_date,days,holidays) returns the date a specified number of working days before or after the start. With the standard function, Saturday and Sunday are weekends. Add the optional holiday range when you need to skip other dates. For the practice request, use a start of 6 November 2026, a positive offset of 2, and a holiday of 9 November 2026. Format the result as a date.

The request opens Friday 6 November 2026. Skip Saturday, Sunday and the Monday closure. Tuesday is workday one and Wednesday 11 November is workday two.
The deadline uses two eligible dates after the start. Friday is the starting date and is outside the forward count.

Check one day at a time before you copy a deadline

Friday 6 November is the given start. Saturday 7 and Sunday 8 are closed. Monday 9 is on the practice closure list. Tuesday 10 is the first counted date and Wednesday 11 is the second. A colleague can verify the deadline without knowing the formula by drawing those dates on a calendar. This hand trace is a useful check when your Excel result seems a day late.

Use a negative offset for a reverse planning question. If the request is due Wednesday 11 November, =WORKDAY(due_date,-1,holidays) gives Tuesday 10. With an offset of −2, you pass Tuesday, skip Monday and the weekend, and get Friday 6. Notice that the due date itself does not count when stepping backward. Use a nonzero offset for this exercise and define the effective date separately if the policy needs a result with zero delay.

Model a policy that counts the first eligible date on or after acceptance

Another team could use a two-working-date window that includes acceptance if it happens on an open date. For the same Friday acceptance, Friday is the first eligible date and Tuesday is the second. This team would give 10 November as its deadline. Both explanations depend on the same weekend and holiday list. Ask the owner which wording applies before interpreting Wednesday as a failed promise.

For the inclusive rule and a positive count, one way to model it is to start the forward search one calendar date before acceptance. If B4 holds 6 November and M2 holds the Monday closure, =WORKDAY(B4-1,2,$M$2) begins searching on Friday. It counts Friday and Tuesday. If a request is accepted on a Saturday that is closed, the same method begins the search on Saturday and crosses through the closed dates until it reaches its first eligible one. Validate that counting convention against the actual plan.

To review a workbook that already has a deadline, test a request whose start is eligible and one whose start is closed. The eligible-start example shows whether the start was included. The closed-start example shows whether the formula can reach the next eligible date without counting the closed day. Keep the examples next to the named rule so the next change has clear expected outcomes.

What changes if Monday 9 November is open?

With the same Friday start and a Saturday/Sunday weekend, Monday is workday 1 and Tuesday 10 November is workday 2. That is one calendar day earlier than the result with a Monday closure.

Use NETWORKDAYS when the answer is a count

NETWORKDAYS counts working dates in a start-to-end range. It includes each endpoint when that date qualifies as a working day. For Friday 6 November through Wednesday 11 November with Monday closed, it counts Friday, Tuesday and Wednesday, giving 3. That same Wednesday was two working days after Friday in WORKDAY. The difference comes from the choice to include the starting date in an interval count.

Trace the first and last dates explicitly

For an eligible Tuesday, a range from that Tuesday to itself counts 1. For a weekend Saturday in the standard policy, the same-date range counts 0. These are useful unit tests because they show exactly what “within the range” means. Use a start before or equal to the end for the ordinary reporting exercises. If a record closes before it opens, review the source dates rather than using the output as a normal count.

Some teams report “working days since opening” and exclude the opening day. For a valid interval whose end is more recent than its start, you can start the inclusive count on the next calendar date by adding one to the starting date. The formula then tests the next date against weekends and holidays automatically. For an opening and report date that are identical, explicitly return zero if that is your policy. Write tests for both these cases before filling the column.

QuestionAnswer typeFunctionCheck with Monday 9 closed
Two working days after Friday 6DateWORKDAYWednesday 11 November
How many working dates are in Friday 6 through Wednesday 11?Whole numberNETWORKDAYS3 includes Friday
Which weekday is Wednesday 11?Whole number tagWEEKDAY with return type 23 for Wednesday
Why can one expression return 11 November and the other return 3?

WORKDAY moves from a start by an offset and returns a date. NETWORKDAYS counts qualified dates in a window, including open endpoints. The results answer separate questions.

Make WEEKDAY's numbering explicit

WEEKDAY returns a number identifying the weekday. With return type 2, Monday is 1 and Sunday is 7. Sunday 8 November 2026 therefore gives 7 in =WEEKDAY(DATE(2026,11,8),2). The default scheme is different. If you build a condition such as “weekend when the result is greater than 5,” supply return type 2 so the test groups Saturday and Sunday as intended.

Keep a tag separate from the operation calendar

WEEKDAY can tell you 9 November 2026 is Monday, but a Monday can still be closed. A simple tag =IF(WEEKDAY(B2,2)>5,"Weekend","Weekday") labels the standard Monday-first weekend pattern. It does not consult a holiday list and does not decide if the team was actually open. For a supported work calendar, a NETWORKDAYS check from a valid date to itself can answer whether that date qualifies.

Use a tag to explain the original data rather than to infer a cause. A ticket logged on Sunday is a Sunday ticket. It could have been logged by an automated service while the human team was closed. A separate effective start field can record when the human service clock began. One date column cannot capture both meanings.

Will WEEKDAY mark a Monday closure as a weekend?

No. The date stays Monday, with tag 1 under return type 2. The closure belongs in the working calendar. Use a same-date NETWORKDAYS check with the holiday range to test eligibility.

Use a custom weekend for the team you are modelling

WORKDAY.INTL and NETWORKDAYS.INTL let you supply a weekend pattern. In both functions the weekend argument comes before the optional holiday range. You can use a documented numeric code or a seven-character text mask. A mask is especially easy to verify when you put the weekday labels above its positions.

The seven mask positions run Monday to Sunday. 0000011 closes Saturday and Sunday. 0000110 closes Friday and Saturday. Zero means open and one means closed.
Read each seven-character text mask from Monday to Sunday. Keep the leading zeroes when storing it.

Keep the seven positions as text

The first character represents Monday and the last character represents Sunday. A zero marks a normal workday and a one marks a recurring non-workday. The text "0000011" therefore closes Saturday and Sunday. "0000110" closes Friday and Saturday. If you type a mask into a worksheet cell, set the cell to Text first or use a leading apostrophe for a text entry. Check that the visible value contains all seven characters. Plain numeric input would drop leading zeros.

Use one reviewed location for the mask. If you copied it from an email, check that it contains only the required digits and that the branch's weekdays agree with the positions. An all-closed calendar cannot produce a future working day. Check that at least one day is open before trying to calculate deadlines.

Use the holiday range for individual dates

A recurring weekend rule can describe every Friday closure. A particular Monday closure belongs in a date range. Proper date values in that range let Excel remove dates that would otherwise be working. A day already closed under the mask still contributes zero days when also listed as a holiday. Treat the rules as describing eligibility per date.

Do not assume one official national calendar is the same as a team's service schedule. Teams can have regional closures, substitute work patterns or shifts. In our practice file, the closure on 9 November is made up. In a real workbook verify which closures are confirmed, which are planned, and whether the business observes a replacement day when a holiday falls on its usual weekend.

Follow the request to its deadline

  1. Find the effective start

    The example request was accepted on Friday 6 November 2026. The promise is measured after acceptance. Use this date as the start, and do not count it as one of the next two working days.

  2. Apply the usual weekend

    Saturday and Sunday are closed in this practice office. Cross out 7 and 8 November. Check whether the usual next working date has an extra closure.

  3. Apply the extra closure

    Monday 9 November appears on the holiday list. The first date eligible after Friday is now Tuesday 10 November. Record how the closure moved the expected date.

  4. Check the destination

    Wednesday 11 November is the second eligible day. WORKDAY returns this date. NETWORKDAYS over the original start and this destination gives 3 because it also includes the open Friday.

Use DATEDIF for complete years and months

A support manager wants to know how long a vendor has completed on the team. DATEDIF takes a start date, end date and a unit and returns a difference. "Y" counts complete years, "M" counts complete months, and "D" counts the elapsed calendar days in ordinary examples. Use valid dates and an end date at or after the start. DATEDIF is a legacy compatibility function. Microsoft documents limitations, particularly with the "MD" unit, which this lesson avoids.

Check the dates immediately around an anniversary

A vendor starts on 8 November 2024. On 7 November 2026 it has completed one full year. On 8 November 2026 it completes two. Subtracting YEAR of the start from YEAR of the end would say 2 in both cases, so it would miss the anniversary condition. Test dates just before and on the qualifying point when a result controls eligibility.

Full months can also be useful for a contract duration. A vendor starting 15 June 2024 has completed 28 whole months as of 2 November 2026, when comparing ordinary dates whose day-of-month exists. A schedule beginning on 29 February or on the 31st can need a documented business rule for anniversary dates in shorter months. Choose and test that rule explicitly before relying on a formula in a sensitive report.

Use direct subtraction when you need ordinary elapsed days

Subtract the earlier numeric date from the later date for elapsed calendar days. An as-of report can use a fixed date cell from the previous lesson. If a record has a future start or a missing date, flag it for review before treating a negative number or an error as a valid tenure. DATEDIF reports an error when the start is greater than the end. That error is useful evidence of a date ordering issue in this reporting scenario.

Why can two records have the same year difference but different completed years?

One record can have passed its anniversary and the other can still be waiting for it. Completed years depend on the date within the year as well as the year number. Compare the result on either side of the anniversary to verify your rule.

Lab 1 · Build a standard office calendar and reproduce the answers

Goal. See the difference between a workday deadline, an inclusive working-day count and a weekday tag. Open a blank editable practice workbook and add a sheet named Office Calendar. Enter the dates with DATE to avoid ambiguity. The practice office normally closes Saturday and Sunday.

  1. Set the window and request. Put =DATE(2026,11,2) in B2 and =DATE(2026,11,30) in B3. Put =DATE(2026,11,6) in B4 for the Friday request. Write clear labels in A2:A4 so you can distinguish the report boundaries from the request date.
  2. Check the ordinary month. Enter =NETWORKDAYS(B2,B3) in C2 and =WORKDAY(B2,10) in D2. Expect 21 working dates through 30 November and a ten-working-day destination of 16 November. Format D2 as a date while C2 stays a whole number.
  3. Add two invented closures. Put =DATE(2026,11,9) and =DATE(2026,11,10) in M2 and M3. In C3 use =NETWORKDAYS(B2,B3,$M$2:$M$3) and in D3 use =WORKDAY(B2,10,$M$2:$M$3). Expect 19 working dates and a destination of 18 November.
  4. Trace Friday's request with one closure. In D4 enter =WORKDAY(B4,2,$M$2). It uses only the 9 November closure in M2. Expect Wednesday 11 November. In C4 use =NETWORKDAYS(B4,D4,$M$2). Expect 3. In E4 use =WEEKDAY(D4,2) and expect 3 for Wednesday. The last two numeric values answer different questions.
  5. Change one assumption. Replace the single-cell closure argument in D4 with $M$2:$M$3. It now skips 10 November too, so expect Thursday 12 November. Recheck how the fixed holiday range differs from the earlier trace. Restore D4 to the single-closure example afterward.
Office Calendar checks
CaseWorking-date countWORKDAY result
November 2 through November 30, no additional closures2116 Nov 2026 for 10 days after Nov 2
Same month window, with November 9 and 10 closed1918 Nov 2026 for 10 days after Nov 2
Friday request and only November 9 closed3 through the deadline11 Nov 2026 for two days after Nov 6

Verify and recover. If the question says after 6 November, do not count Friday in the WORKDAY trace. If the month count is 21 even after adding the closures, inspect the actual holiday argument and confirm both values are numeric dates. For this lab the short-range request intentionally includes just M2, whereas the whole-month check includes both. Make your formula match the documented example before drawing a conclusion.

Lab 2 · Compare branch weekends and measure tenure

Goal. Hold the start date and offset constant while changing the weekend rule, then check a complete-year boundary. Create another scratch sheet named Branch Calendar. The code masks here are teaching assumptions and do not state a policy for any real service. Put the common 9 November 2026 closure in J2 with =DATE(2026,11,9).

  1. Lay out the two branches. In A1:F1 type Branch, Start Date, Offset, Weekend Mask, Deadline and Open Through Saturday. In A2 put Sat/Sun branch and A3 Fri/Sat branch. In each B cell put =DATE(2026,11,6). In C2 and C3 type 2.
  2. Store two text masks. Put the text 0000011 in D2 and 0000110 in D3. Use Text format before entering them or enter each with a leading apostrophe. Recheck the initial zeros. Write “Mon to Sun” in a nearby note so the order of mask positions is clear.
  3. Compare deadlines. In E2 write =WORKDAY.INTL(B2,C2,D2,$J$2) and copy to E3. Format both cells as dates. The Sat/Sun branch reaches Tuesday then Wednesday, so expect 11 November. The Fri/Sat branch can count Sunday, skips Monday and then counts Tuesday, so expect 10 November.
  4. Compare a short count window. In F2 enter =NETWORKDAYS.INTL(B2,DATE(2026,11,7),D2,$J$2) and copy it down. The window includes Friday and Saturday. The Sat/Sun branch counts Friday, giving 1. The Fri/Sat branch closes both dates and counts 0.
  5. Check complete years. Use a separate area of the sheet for tenure. Put =DATE(2024,11,8) in H6, =DATE(2026,11,7) in H7 and =DATE(2026,11,8) in H8. Use =DATEDIF($H$6,H7,"Y") in I7, then fill to I8. Expect 1 and 2. Subtract H6 from each end date separately if you also need total calendar days.

Expected evidence. The two branches have the same requested delay but different deadlines. If both dates match, inspect the mask reference after copying and confirm J2 holds only the common closure. If the tenure result is unexpected, compare the full dates rather than just their years. The end date immediately before the anniversary and the exact anniversary should show different completed-year counts. Save the synthetic copy or close it after verification.

Audit the calendar before grading a service metric

A manager asks whether a request was resolved on time. You have the opening date, the promised duration, the assigned branch and the completion date. First calculate the deadline from the branch's calendar. Then compare the completion date with the deadline according to the agreed rule. For this sample, a completion on the due date counts as on time. With an hourly cut-off, you also need the time and a consistent timezone before evaluating the result.

Check the edge cases a summary can hide

  • Blank completion. Treat a request with an unknown completion date as open or missing, according to the source. Do not compare a blank as zero and accidentally classify it as resolved before the deadline.
  • Opening after a report date. A planned request may be outside the report window. Verify its status and the report's as-of date instead of treating every future record as a data error.
  • Changing office schedule. If the branch changes its weekend pattern later, keep the policy applicable to the original event. Recalculating an old report with a new weekend mask can change historical outcomes.
  • Holiday list errors. Look for date-shaped text, the wrong year, and a closure listed for the wrong branch. Test one known holiday with a same-date count and one ordinary weekday that should count.

To isolate a mistake, choose a one-week slice with a known start, one weekend and one extra closure. Draw the dates in order. Compare which day Excel includes with which day the policy includes. Then change exactly one input, such as whether Monday is open, and predict the new output. This gives you a stronger check than comparing two formulas that depend on the same incorrect calendar list.

Label and maintain the calendar inputs

Store one closure date per row in a named area or an input sheet. Record the region, team and reporting period when multiple lists coexist. A formula using a fixed holiday range can miss new rows you add below it. After editing the calendar, inspect the reference or use a reliably managed table or named range. Check that all output formulas read the current approved calendar for their cases.

Affected and unaffected cases make a useful pair of tests. For example, adding a new closure on Monday 9 November affects the Friday request, but a separate request beginning after Wednesday 11 should not be affected by that Monday. Check both outputs and write down the one change you made. Keep a date or version on the policy if the calendar is used for published metrics.

Build an on-time report with a clear denominator

Suppose a store manager asks “what share of this week's support requests were completed by their deadline?” The team has four tickets and a standard Saturday and Sunday weekend. Monday 9 November is a practice closure. The clock starts from each ticket's effective accepted date, and completing on the due date qualifies as on time. One ticket is still open. First calculate valid deadlines and statuses, then choose a denominator that matches the report question.

Keep each case's dates and outcomes together

On a scratch worksheet put Case, Effective Start, Promised Days, Completed Date, Due Date and Status in A1:F1. Use the input dates and offsets from the table below. Enter the dates with DATE or the confirmed locale convention and leave the open ticket's completion field genuinely blank. Put the confirmed closure date in K2. This example assumes the recorded completion is a date without hidden time and the reported service promise is measured in full working dates.

November 2026 office cases, with Monday 9 closed
CaseEffective startDays afterCompletedDueStatus
T-0106 Nov212 Nov11 NovLate
T-0210 Nov111 Nov11 NovOn time
T-0310 Nov2Leave blank12 NovOpen
T-0405 Nov206 Nov10 NovOn time

In E2 use =WORKDAY(B2,C2,$K$2). Copy it down through E5. Trace the last case manually. Workday 1 after Thursday is Friday 6. Workday 2 after the weekend and closure is Tuesday 10. The completion on that Friday was early. This check is useful when an output happens to match a calendar-day calculation for another case.

In F2 use =IF(D2="","Open",IF(D2<=E2,"On time","Late")) and fill to F5. The first condition handles a blank result before comparing dates. The second condition compares a recorded completion date at or before the deadline. Keep a separate data-quality check for completion dates earlier than the effective start. The two conditions here assume validated dates and do not make a malformed source valid.

Say which records are included in the rate

There are two on-time completions and one late completion in the example. The on-time share of completed tickets is 2 out of 3. Dividing by all four gives 2 out of 4, which answers the different question “what share of opened tickets already have an on-time completion?” A separate Open count makes it clear why the denominators differ. If no tickets are completed, the first rate has no observations and a percentage would mislead.

A fixed as-of date is important when you publish these results. Use 12 November 2026 for this teaching report and state that the status shown is as of that date. If T-03 completes on a later day, keep the original report or filter the source by the cutoff before recomputing a historical view. Otherwise the completed metrics can change even though the original working-calendar rules remained correct.

Why should the open ticket stay out of the completed-ticket percentage?

The denominator represents completed tickets. The open one has no completion date to compare. Keep its count visible separately. Include it only in a different metric with an explicit definition.

Make a changing schedule visible as one row per date

A single weekend mask works when the team follows the same pattern throughout the dates being evaluated. Suppose a practice branch closes Saturday and Sunday before Monday 9 November, then switches to Friday and Saturday after that week. One mask cannot express both periods in a single call. The source calendar now needs a rule for each part of the period, or a list of actual working dates.

Compare an explicit calendar with a formula result

Make a small audit table for 6 through 12 November 2026. Enter =DATE(2026,11,6) in A2 and =A2+1 in A3. Fill the second expression down until the list reaches the 12th. Label a second column Working Date Flag. On the standard practice calendar with Monday 9 closed, enter =NETWORKDAYS(A2,A2,$J$2) beside the first date, where J2 holds that Monday closure. Fill it through the week and expect 1 on Friday, 0 on Saturday, 0 on Sunday, 0 on Monday, and 1 on Tuesday, Wednesday and Thursday.

Summing these flags gives 4 for the full seven-calendar-date span. You can verify that by counting the labelled dates. For the actual Friday request, stop after the second qualifying row strictly after the Friday start. It still reaches the 11th. The explicit list gives reviewers a way to see each day's classification, which is useful if one closure appears in the wrong range or comes from the wrong branch.

Use dated policies when rules vary

For a calendar that changes, record the effective date of each policy. Assign each date its applicable weekend rule, then apply the relevant closure list. If two rules overlap, check which policy controls the overlap before counting. Each eligible date belongs to the final list once. Splitting a range into subperiods requires careful interval boundaries because inclusive counts can double-count a boundary date used as both the end of one period and the start of the next.

As a handover, add the label, date and version of the source calendar, plus a worked test before and after the rule change. A co-worker should be able to take the same opening date, select the same branch and reproduce the same result. When a standard function cannot express the full schedule, a transparent date list makes the chosen business rule visible in Excel.

Apply the rules to three quick cases

  1. Work backward from a due date. Start on Wednesday 11 November 2026 and go back two working days with Saturday and Sunday closed and Monday 9 as a holiday. Check. Friday 6 November. Tuesday counts first, then the weekend and closure are skipped.
  2. Test an additional weekend closure entry. Put Saturday 7 November on the standard branch holiday list as well as Monday 9. Recalculate its Friday request. Check. The due date stays Wednesday 11. Saturday was already excluded.
  3. Catch an anniversary boundary. Compare a start of 15 June 2024 with two report dates, 14 June 2026 and 15 June 2026. Check. DATEDIF with unit Y returns 1, then 2. Explain how a year-only calculation loses that boundary.

Check your understanding

1. Which function returns a date two standard working days after a start?
  • A. WEEKDAY
  • B. WORKDAY
  • C. NETWORKDAYS

Answer B. WORKDAY moves forward by working dates. NETWORKDAYS counts dates in a supplied interval, and WEEKDAY identifies the weekday number. Use a holiday range if the forward search must also skip a closure.

2. Friday and the following Wednesday are both open. The weekend and Monday are closed. How many open dates are in the inclusive interval?
  • A. 3
  • B. 2
  • C. 6

Answer A. Count Friday, Tuesday and Wednesday. The interval includes the opening Friday. A calculation of two workdays after Friday moves to the same Wednesday without counting Friday as a step.

3. In the text mask 0000110, which days close each week?
  • A. Monday and Tuesday
  • B. Saturday and Sunday
  • C. Friday and Saturday

Answer C. Positions begin with Monday, so the fifth and sixth ones stand for Friday and Saturday. The last zero keeps Sunday open unless it is listed as a holiday.

4. What does WEEKDAY return for Sunday with return type 2?
  • A. 1
  • B. 7
  • C. It returns the text Sunday

Answer B. Type 2 labels Monday as 1 and Sunday as 7. The output is a number. A separate tag or a display format can show a weekday name if that is the preferred output.

5. What numeric result should NETWORKDAYS return for one working Tuesday used as both start and end?
  • A. 1
  • B. 0
  • C. The next Wednesday

Answer A. The inclusive range has one distinct date, and it qualifies as a working day. If that date were a closure in the chosen calendar, the count would be zero.

6. Which check is best when using DATEDIF to report completed years?
  • A. Test only the two year numbers
  • B. Assume every year has the same number of calendar days
  • C. Test the day before an anniversary and the anniversary itself

Answer C. Completed years change at the anniversary. The two neighbouring dates show whether the calculation observes the intended boundary. For special contract rules about leap-day anniversaries, validate against the business policy.

Interview questions with worked answers

How would you calculate a three-working-day deadline?

I establish the effective start date, confirm the counting rule and identify whose days and closures apply. For a Saturday/Sunday calendar I can use WORKDAY with the holiday range. For another pattern I use WORKDAY.INTL and check its mask. I verify the formula with a case crossing a weekend and a closure.

Why can NETWORKDAYS give a larger number than the offset used in WORKDAY?

NETWORKDAYS counts qualified dates within the window, including both endpoints when open. WORKDAY with a positive offset takes steps after the given start. In the Friday request example, Friday, Tuesday and Wednesday lie in the interval, while only Tuesday and Wednesday are steps after Friday.

How would you decide whether a Monday counts as open?

I cannot decide from the weekday name alone. I check the actual branch schedule and its list of special closures. A same-date working-day count with that calendar returns 1 for open and 0 for closed. A WEEKDAY tag still identifies the date as Monday in both cases.

How do you store two different branch calendars?

I maintain the recurring masks and closure dates separately and map each ticket to its responsible calendar. The masks stay as seven-character text. I test a case where the masks differ so a copied formula that accidentally uses the same mask everywhere will fail visibly.

How do you verify a completed-years result?

I use fixed dates and check the period on either side of an anniversary. An ordinary DATEDIF example on the exact date gives the completed year count. For rules with unusual dates or eligibility consequences I compare against the written policy and test the exact boundary. I use direct subtraction for elapsed calendar days.

Quick recall cards

  • Calendar day

    Every date counts. Simple date addition works for a fixed offset of calendar days.

  • WORKDAY

    Returns the date reached after stepping across open dates. Supply a holiday range when needed.

  • NETWORKDAYS

    Counts eligible dates in a range, including endpoints that qualify.

  • WEEKDAY

    Return type 2 gives Monday 1 through Sunday 7. The label gives no evidence of an extra closure.

  • Custom mask

    Seven characters from Monday to Sunday. Zero means a usual working date, one means closed.

  • Completed years

    Whole years depend on the anniversary date. Test the boundary and document any exceptional policy.

The next lesson uses times and durations. A working-day calculation can tell you a date. It cannot by itself tell you which hours within the date a service is open or whether a shipment was delivered before its hourly promise.

Official Microsoft references

Continue practising: explore the existing Excel Task Hub for additional exercises.