View Single Post
  #5   Report Post  
Biff
 
Posts: n/a
Default

example : 28-MAY-05 08:30 till 30-MAY-05 11:15

The time I want is on the 30th (Monday) from 9:00 till 11:15 but I get
an extra day and 7 hours using the formula.


Workhours is from 08:00 till 17:00 on a week day.


If the normal business hours are from 8:00 to 17:00 then why do you want:
"from 9:00 till 11:15 "

Let me ask you this, what result do you expect?

A1 = 28-MAY-05 08:30
B1 = 30-MAY-05 11:15

=IF(NETWORKDAYS(A1,A1)=1,17/24-MOD(A1,1),0)
+IF(NETWORKDAYS(B1,B1)=1,MOD(B1,1)-8/24,0)+NETWORKDAYS(A1+1,B1-1)*9/24

Returns (in h:mm format): 3:15

May 30 2005 was the Memorial Day holiday so I assume you do not want to use
the excluded holidays argument for the Networkdays function. If you did
include that argument and had May 30 2005 listed then the result would have
been 0.

Biff

wrote in message
ups.com...
or if possible - if i have a date to check if it is a workday or not
and if it is not, then I want the previous or next working day