if you only want to count hours between 9:00 and 17:00 Monday to Friday then you need a more complex formula if you want to allow the callout/arrival times/dates to be outside those times e.g. 09:00 on a Saturday. Try this version
=(NETWORKDAYS(B2,D2)-1)/3+IF(NETWORKDAYS(D2,D2),MEDIAN(E2,"9:00","17:00"),"17:00")-MEDIAN(NETWORKDAYS(B2,B2)*C2,"9:00","17:00")
Bookmarks