View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Using an IF statement on time based data

or equivalently...

=if(((d12-c12)+(f12-e12)+(h12-g12))=8/24,8/24,(d12-c12)+(f12-e12)+(h12-g12))

But

=min(time(8,0,0),((d12-c12)+(f12-e12)+(h12-g12)))
or
=min(8/24,((d12-c12)+(f12-e12)+(h12-g12)))

would seem reasonable.


DonB wrote:

I guess that I am not explaining the problem very well. There are six
columns of data representing the beginning and ending times for the morning,
afternoon, and evening time frames. I have no problem in calculating the
total time worked. However, when I apply an IF statement against the total
to determine if overtime has been worked, the result is .46875 every time.
My equation is
=if(((d12-c12)+(f12-e12)+(h12-g12))=8,8,(d12-c12)+(f12-e12)+(h12-g12)). I
have tried different formattings without success.
--
DonB

"Dave Peterson" wrote:

=MIN(A1,TIME(8,0,0))

would be one way (with the time worked in A1)

DonB wrote:

I have a worksheet of payroll time data by date that i want to identify
overtime amounts in excess of 8 hours. I can't seem to write an IF statement
that correctly answers the question "If 8 hours or more, enter 8 hours, if
less then the the calculated time. It seems to be a formatting problem of
moving from time formats to number formats. HELP.
Thanks
--
DonB


--

Dave Peterson


--

Dave Peterson