Your formula should work OK for start and end times that are within working hours. The first negative number is caused because 16th February 2013 was a Saturday. In your last example 09:32 AM and 09:12 PM can't both be within an 11 hour working day. Assuming a working day 08:00 to 19:00 you can use this revised formula to work with start/end dates/times that may be outside working hours
=(NETWORKDAYS(A1,B1)-1)*("19:00"-"8:00")+IF(NETWORKDAYS(B1,B1),MEDIAN(MOD(B1,1),"8:00","19:00"),"19:00")-MEDIAN(NETWORKDAYS(A1,A1)*MOD(A1,1),"8:00","19:00")
Bookmarks