eg#1.: A1=START DATE/TIME & A2=END DATE/TIME & A3=RESULT ([hh]:mm)
A1 11-01-2008 09:00:00
A2 11-01-2008 11:00:00
A3 02:00
eg#2.: A1=START DATE/TIME & A2=END DATE/TIME & A3=RESULT ([hh]:mm)
A1 11-01-2008 09:00:00
A2 14-01-2008 11:00:00
A3 11:00
eg#3.: A1=START DATE/TIME & A2=END DATE/TIME & A3=RESULT ([hh]:mm)
A1 14-01-2008 09:00:00
A2 16-01-2008 11:00:00
A3 20:00
Try this
=(NETWORKDAYS(A1,A2)-1)*(B2-B1)+IF(NETWORKDAYS(A2,A2),MEDIAN(MOD(A2,1),B2,B1),B2)-MEDIAN(NETWORKDAYS(A1,A1)*MOD(A1,1),B2,B1)
Where:-
A1= Earlier date/time
A2= Later date/time
B1 = 08:00
B2 = 17:00
Mike
maybe
http://www.sulprobil.com/html/count_hours.html
can help you somewhat. It does not take holidays into account, though.
Regards,
Bernd
Your other response made me aware that I'd missed publich holidays so change
to this
=(NETWORKDAYS(A1,A2,C1:C8)-1)*(B2-B1)+IF(NETWORKDAYS(A2,A2),MEDIAN(MOD(A2,1),B2,B1),B2)-MEDIAN(NETWORKDAYS(A1,A1)*MOD(A1,1),B2,B1)
Where C1 to C8 is your holiday list. Just a point to note is that I have
assumed that a public holiday wouldn't be either of the dates in A1 or A2. If
these dates were public holidays then the real start/end date is a day
later/earlier and in any case I'm struggling to work it out otherwise.
Perhaps someone can enlighten us.
Mike
Here is my formula:
=(NETWORKDAYS(A2,B2)-1)*(D2-C2)+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1),D2,C2),D2)-MEDIAN(NETWORKDAYS(A2,A2)*MOD(A2,1),D2,C2)
A2 = 1/16/2008 10:00 am
B2 = 1/22/2008 9:34 am
C2 = 08:00 am
D2 = 17:00 pm
My results are showing 1.48
Thanks,
Kamp
From many days I am working on this, but not able solve this issue. Thanks
for your help...
Regards,
Rohit