View Single Post
  #5   Report Post  
B.D.
 
Posts: n/a
Default

Hi, Jason--

Thnaks for ytour help! I'm going to take yours and Myrna's suggestions =
and=20
see if I can get my sheet to work. Sorry it took so long to reply, but =
I'd=20
reached my frustration point with the thing and just went to bed. I'll =
let you=20
know how this whole thing plays out when I get into it later today!
-----Original Message-----
Try:=20

=3DNETWORKDAYS(A1,B1,J1:J10)-2+(1-MOD(A1,1))+MOD(B1,1)=20

where J1:J10 is your list of holiday dates, A1 is the=20
start date/time, and B1 is the end date/time. You can=20
simplify the formula further using:=20

=3DNETWORKDAYS(A1,B1,J1:J10)-1-MOD(A1,1)+MOD(B1,1)=20

Make sure the analysis toolpak is installed under Tools=20
Add-Ins. Otherwise you'll get a #NAME? error.

HTH=20
Jason=20
Atlanta, GA=20


-----Original Message-----
I have no idea where I've gone wrong. Given the=20

following=20
cells:

J13=3D Start Date & Time
K13=3DEnd Date & Time
AE66:AE83=3DRange of non-working holidays
H5=3D Start of workday (a time)
H6=3DEnd of workday (also a time)

I've evolved (with a lot of help) the followng formula.=20
It is supposed to return the number of workdays and=20
workhours between the start date and time and the end=20
date and time. Much of the time it works pretty well,=20

but=20
too often I'm getting negative hour counts. I have no=20
idea where I've gone wrong. HELP! I'm desperate and=20
tired. Here's the formula:

=3DIF(AND(INT(J13)=3DINT(K13),NOT(ISNA(MATCH(INT (J13),
AE66:AE83,0)))),"0 days 0 hours", IF(INT(J13)=3DINT(K13),
"0 days " & ROUND(24*(K13-J13),2)&"hours",
MAX(NETWORKDAYS(J13+1,K13-1,AE66:AE83),0)+
INT(24*(((K13-INT(K13))-(J13-INT(J13)))+
('H6'-H5))/(24*('H6'-H5)))&
" days "&MOD(ROUND(((24*(K13-INT(K13)))-24*H5)+
(24*'H6'-(24*(J13-INT(J13)))),2),
ROUND((24*('H6'-H5)),2))&" hours "))

Does anyone know how I can rewrite this to make it=20
consistent? All I need is, for a wide variety of=20
starting and ending dates/times, to calculate the number=20
of workdays and workhours between the two.
.

.