Condition on Time

C

Chris

I calculate the number of hours daily worked. I have column A: timeIn, Column
B: TimeOut, Column C calculates the total hours done, which is fine. I am
trying to enter a formula in column D which will say something like this: If
the number of hours in column C is greater than 4:00 hours, then 30 minutes
have to be substracted to it.
How can I do this?
I have tried : IF(C3Time(4,0,1), "-0:30"), to no avail.
Any help appreciated.
 
T

Toppers

in C3 put:

=(B3-C3)*24 to convert time to decimal hours e.g. 7:30 ==>7.5 and format
cell as general

in D3

=If(C3>4,C3-0.5,C3)

HTH
 
C

Chris

Thanks HTH,
It works, but I still need to see the result as hours: hh:mm, at the moment
I end up with only a digit, with lots of decimals, can the result in D3 be
converted back into time? I have tried to format the cell to Time, but it
does not work.
Thanks for your help.

Chris.
 
T

Toppers

=IF(C3>4,(C3-0.5)/24,C3/24)

format as hh:mm

Chris said:
Thanks HTH,
It works, but I still need to see the result as hours: hh:mm, at the moment
I end up with only a digit, with lots of decimals, can the result in D3 be
converted back into time? I have tried to format the cell to Time, but it
does not work.
Thanks for your help.

Chris.
 
Top