This is rather complicated, so I'll do my best to explain the problem I am
having. I previously asked this question:

I have created a spreadsheet that calculates process times. If a product is
held overnight, then excel subtracts 15 hours from the total to account for
15 hours that are non-working hours, if a product is held over a weekend,
then excel subtracts 62 hours of non-working time (24x2 for Sat. & Sun. +15
for Fri. night). The problem I am running into is that if a product is held
for 1 or 2 days and those days are NOT weekends, then I only want it to
subtract the 15 hours for however many days.

I received the following answer:

=(NETWORKDAYS(D2,F2)-1)/2.67+G2-E2)
This will calculate the working hours between your in and out times,
based on a 9 hour day, assuming that in and out times are always
within working hours. It will take weekends into account and can also
be amended to cope with holidays if you want to do that.

The problem I am having now is that the in and out times are NOT always
within working hours, but I still only want to count the working hours. I
don't understand what function -1 has in the formula above either.