The Weekday function won't work either because it doesn't account for holidays. With NETWORKDAYS, I can define a list of company Holidays to exclude and just insert them on a new tab or have a macro add a column with them already typed and use that range in the formula.

I've resolved the NETWORKDAYS problem. The other day I wrote, "I take the total NETWORKDAYS, subtract the start day if it's a NETWORKDAY and then subtract the end day if it's a NETWORKDAY. " I'll explain what I mean.

NETWORKDAYS(A2,A2) tests only cell A2 to see if it's a NETWORKDAY. If cell A2 is a networkday, the answer is 1. If not, the answer is 0. This way I can take the total Networkdays [NETWORKDAYS(A2,B2)] and subtract the start and end days if they are network days like so:

(NETWORKDAYS(A2,B2)-NETWORKDAYS(A2,A2)-NETWORKDAYS(B2,B2))*28800

This eliminates the IF statements as well. Using this same method, I can calculate the seconds between 9am and 5pm and multiply that result by whether or not it's a networkday. Ex.: 3600 seconds multiplied by 1 for a networkday or 0 for a weekend day.

I think I've got the seconds of those two days figured out using MOD, MIN, and MAX as well without the need for IF statements. For the start day, I've got:

0.708333-MAX(MIN(0.708333,MOD(A2,1)),0.375) multiplied by the test for networkdays (NETWORKDAYS(A2,A2) to keep the result or use 0. This takes the smaller of the start time (MOD(A2,1)) or 5:00pm and then uses that result to get the larger of the result or 9:00am. The result of that comparison is then subtracted from 5:00pm to count all the time in between.

__The tests__
6:00pm start: the smaller of 6pm and 5pm is 5pm. the larger of 9am and 5pm is 5pm. 5:00pm minus 5:00pm is 0 seconds.

8:00am start: the smaller of 8am and 5pm is 8am. the larger of 9am and 8am is 9am. 5:00pm minus 9:00am is 28800 seconds.

4:00pm start: the smaller of 4pm and 5pm is 4pm. the larger of 9am and 4pm is 4pm. 5:00pm minus 4:00pm is 3600 seconds.

I can use a derivative of that for the end day.

The only IF I can't seem to shake is when I have to figure out if the start and end are the same day. I don't want to add the time twice. But even that single day can be multiplied by NETWORKDAYS(A2,A2) to get a 0 or 1 multiplier. I'm also starting to think that we can subtract the start day networkday and add the actual seconds in the same calculation, but then it gets harder for me to explain. It seems to get algebraic and I've forgotten my algebra.