ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Networkdays function doesn't find true difference between two dat (https://www.excelbanter.com/excel-worksheet-functions/112948-networkdays-function-doesnt-find-true-difference-between-two-dat.html)

sesler2

Networkdays function doesn't find true difference between two dat
 
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.

Ron Rosenfeld

Networkdays function doesn't find true difference between two dat
 
On Wed, 4 Oct 2006 18:46:02 -0700, sesler2
wrote:

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

Teethless mama

Networkdays function doesn't find true difference between two dat
 
=NETWORKDAYS(A2,A3-1)

"sesler2" wrote:

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.


Dave Peterson

Networkdays function doesn't find true difference between two dat
 
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 Rosenfeld wrote:

On Wed, 4 Oct 2006 18:46:02 -0700, sesler2
wrote:

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


--

Dave Peterson

Ron Rosenfeld

Networkdays function doesn't find true difference between two dat
 
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.



On Wed, 04 Oct 2006 22:09:56 -0500, Dave Peterson
wrote:

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 Rosenfeld wrote:

On Wed, 4 Oct 2006 18:46:02 -0700, sesler2
wrote:

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


--ron

Dave Peterson

Networkdays function doesn't find true difference between two dat
 
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!)

Ron Rosenfeld wrote:

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.

On Wed, 04 Oct 2006 22:09:56 -0500, Dave Peterson
wrote:

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 Rosenfeld wrote:

On Wed, 4 Oct 2006 18:46:02 -0700, sesler2
wrote:

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


--ron


--

Dave Peterson


All times are GMT +1. The time now is 04:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com