Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup Data in two seperate Spreadsheets Padraig Excel Worksheet Functions 6 June 28th 06 03:05 PM
Can't use Find function in formula Winnie Excel Discussion (Misc queries) 1 June 26th 06 08:21 AM
how to find time difference between timestamps to a millisecond? sp New Users to Excel 2 June 16th 06 06:10 PM
What function would let me find Batting Averages? pertimesco Excel Worksheet Functions 2 March 1st 05 01:38 PM
What function would let me find Batting Averages? pertimesco Excel Worksheet Functions 1 March 1st 05 01:03 PM


All times are GMT +1. The time now is 07:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"