Networkdays function doesn't find true difference between two dat

S

sesler2

I am trying to use networkdays function. Please note your help on this topic
- I have pasted the e.g. in question below:

a2 = 6/8/2007
a3 = 6/20/2007

Formula Description

1. =A3-A2 Days between the two dates (12)
2. =NETWORKDAYS(A2,A3) Weekdays between the two dates (9)

The difference in 1 is correct - there is 12 days between - i am trying to
find a duration period here.
The difference in 2 is incorrect - 12 days - 4 weekend days - should be 8
It seems to be including the start date which is what happens when I uses
this function in my spreadsheet. It is calcuating 1 extra day. Please tell
me how this function can work correctly. I cant just take 1 day off as it
might not always span a weekend.
 
R

Ron Rosenfeld

I am trying to use networkdays function. Please note your help on this topic
- I have pasted the e.g. in question below:

a2 = 6/8/2007
a3 = 6/20/2007

Formula Description

1. =A3-A2 Days between the two dates (12)
2. =NETWORKDAYS(A2,A3) Weekdays between the two dates (9)

The difference in 1 is correct - there is 12 days between - i am trying to
find a duration period here.
The difference in 2 is incorrect - 12 days - 4 weekend days - should be 8
It seems to be including the start date which is what happens when I uses
this function in my spreadsheet. It is calcuating 1 extra day. Please tell
me how this function can work correctly. I cant just take 1 day off as it
might not always span a weekend.

Networkdays includes both start_date and end_data in its calculation.

So if your start_date was Monday, and your end_date was Friday, networkdays
would show that you worked five days.

If your start_date was Monday, and your end_date the following Monday,
Networkdays would show that you worked six days.

Here is the logic for treating it this way:

If I was the employee, and Monday was my start_date, and Friday my end_date, I
would sure want to get paid for five days.

Similarly, if my start_date at work was Friday june 8, 2007, and my last day at
work was Wednesday, June 20, 2007, I'd sure want to get paid for nine days, and
not eight.

In any event, if you don't want to include either start_date or end_date,
merely subtract one.


--ron
 
D

Dave Peterson

But if the start date and/or the end date isn't a weekday, then they're not
included in the difference.

=networkdays(date(2006,10,7),date(2006,10,8))-1
won't return the correct answer.

And if one of those dates is in the list of holidays, then it gets ugly
fast--well, for me anyway.

I was thinking that you could offset the dates to start on a Monday. But then
holidays and weekends could screw it up (I think).

Am I wrong?
 
R

Ron Rosenfeld

That's true. I was not entirely clear.

I look at the NETWORKDAYS function as providing an inclusive count of all
working days -- in other words, the number of working days, inclusive, from
start_date to end_date. For example, you could project payroll with that
information, where you couldn't by using an algorithm like
end_date-start_date-weekends.

If that is not the goal, then NETWORKDAYS is the wrong tool.



But if the start date and/or the end date isn't a weekday, then they're not
included in the difference.

=networkdays(date(2006,10,7),date(2006,10,8))-1
won't return the correct answer.

And if one of those dates is in the list of holidays, then it gets ugly
fast--well, for me anyway.

I was thinking that you could offset the dates to start on a Monday. But then
holidays and weekends could screw it up (I think).

Am I wrong?

--ron
 
D

Dave Peterson

As a worker, I always felt that the day started at: 12:00:01AM and finished
11:59:59PM. So I'd want to include those end days. (Sometimes, my bosses
disagreed!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top