Ron Rosenfeld Wrote:
On Tue, 18 Oct 2005 18:07:37 -0500, Ltat42a
wrote:
The form I'm using does have a cell for the date that the overtime is
worked. The formula I'm using does not reference that cell.
If the date cell was included in the formula, is there a way the time
calculation can be changed to reflect 24 hours instead of 0?
Thanx
JF
I'm not sure I understand the form.
But if you are entering a start time and a stop time, and the
difference could
be more than 24 hours, you need to somehow also reference a start date
and stop
date. If this could be obtained from some other cells, then the
formula you
would use would be:
=24 * ((StopDate+StopTime) - (StartDate+StartTime))
Format the result as number with an appropriate number of decimal
places.
The logic:
Excel stores dates as serial numbers (starting with 1/1/1900 or
1/1/1904) and
times as fractions of a day. So the above formulas merely combine to
produce
what you would obtain if you entered the date and time in the same
cell.
Multiplying by 24 transforms the result into decimal hours, which can
then be
multiplied by an hourly rate.
--ron
As for the form, I have a "Time in" cell - the time you arrived for
your shift,
I have a "Time out" cell - the time you ended your shift. In some
cases, this will be a 24 hour shift, in other cases it will be less (we
don't get paid for travel time from one station to the other). I also
have a date cell.
Can my formula use a IF statement? If D4 = 07:00, & B4 = 07:00, the
result would be 24, if anything else exists, then do the above
calculation. I.E. - If B4 = 07:30 & D4 = 07:00 - the result is
23.5hrs.
My formula works good unless you work a 24hr shift - the result comes
up 0.
Thanx.....JF
--
Ltat42a
------------------------------------------------------------------------
Ltat42a's Profile:
http://www.excelforum.com/member.php...o&userid=24735
View this thread:
http://www.excelforum.com/showthread...hreadid=477255