View Single Post
Old 23-02-2008, 14:37   #2 (permalink)
nullmouse

 
nullmouse's Avatar

nullmouse is on a distinguished road with 20 reputation points.

Profile
location: Aberdeen
joined: Aug 2003
posts: 1,059

Default

I don't know how to do it using proper times, but if you express times as hours plus minutes as decimal (e.g. 21.00 would be 9:00pm, 1.25 would be 1:15am) then this should work:

=((IF(C2<B2,C2+24,C2))-B2)

Where B2 = Start time, C2 = End time, as per your screen shot.

Obviously not ideal, but I don't know how to do it using actual times :/

I should say this works in Microsoft Excel, but should work in most spreadsheets - The IF formula is to adjust any times in am to be 24 hours greater than the pm start time, to allow subtraction to get the hours. This obviously assumes you don't work shifts of longer than 24h The second clause if the IF statement allows you to enter end times of before midnight the same day.
nullmouse is offline   Reply With Quote