Not clear if you want the results as true time values or in decimal hours.

In terms of true time, perhaps:

=MAX(0,(NETWORKDAYS($A5,$B5,$D$2:$D$113)-1)*($F$2-$E$2)+IF(NETWORKDAYS($B5,$B5,$D$2:$D$113),MEDIAN(MOD($B5,1),$F$2,$E$2),$F$2)-MEDIAN(NETWORKDAYS($A5,$A5,$D$2:$D$113)*MOD($A5,1),$F$2,$E$2))
copied down
format cell as [h]:mm:ss

if you want in terms of decimal hours (eg 1.5 for 1:30) multiply above result by 24.