Re: NETWORKDAYS but counting the hours not the days...

From: Myrna Larson (myrnailarson_at_chartermi.net)
Date: 07/02/04


Date: Fri, 02 Jul 2004 17:35:17 -0500


>I interpreted your "no time given" as an empty cell, whereas you meant a cell
>with only the date. So discard that completely.

Yes, I meant a date without a time.

>That's where our vision differ. My position is that checkin and checkout
times
>(Date1 and Date2) are full timestamps _without_ any special treatment of the
>case where one/both of them occur on midnight (or any specific time for that
>matter).

If you want to REQUIRE that both a date and time be specified, then certainly
there's no reason to modify the user's entry in any way other than to shift it
to the beginning or end of the work day.

>But I do understand that _IF_ you have to treat a date without time (so
having 0
>for time) differently, that's the way you have to proceed.
>"It's not a bug, it's a feature." <g>

Yes, that's what I intended -- the "feature" that you didn't have to specify a
time if you want to include the entire working day. But it does have the
drawback that when you DO specify a time, you can't use EXACTLY 0:00:00,
because there's no way to distinguish between that time and
"time-not-specified".

>These kind of time calculation problems occur in a variety of context. One of
>which is to answer the following problem: A machine breaks at T1 (full
>timestamp : date+time) and is repaired at T2 (again full timestamp). What is
the
>missing production time (between 8:00 and 17:00) not counting
>week-ends/holidays? Because the machine can break anytime during the day, you
>need the calcs we're talking about.

To be a bit "picky", it would seem to me that the machine would only break
during the time it's in use, i.e. during regular working hours. But the end
time could be outside of regular hours, assuming you call in the repairmen and
they work during the evening until it's fixed.

>Also, even from a 'workers' time*** perspective, we frequently want to pay
the
>hours differently during specific period (8:00 to 17:00) when some work is
done
>inside the period and some work is done outside.

That was my puzzlement with this problem: rather than ignore hours outside the
regular day -- "throwing them away" so to speak -- if we are talking about
hours worked, those hours would in most businesses generate EXTRA pay, not NO
pay. In the past (at least several years ago) I've posted formulas and/or code
to calculate the pay for regular hours and overtime.