View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Subtraction formula

This seems to work

=MOD(D20-C20,1)-((AND(C20<=TIME(2,0,0),(D20=TIME(2,30,0))))+(AND( C20<=TIME(10,0,0),(D20=TIME(10,30,0))))+(AND(C20< =TIME(18,0,0),(D20=TIME(18,30,0))))
+(AND(C20D20,D20=TIME(2,30,0))) )*TIME(0,30,0)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"kevcar40" wrote in message
...
Hi
I have a worksheet containing time faults occur
ie
Start time End Time
06:23:12 07:23:12
08:10:23 12:10:23
08:25:10 04:25:10

what i am looking to do is subtract the start time from the end time
and exclude break times
ie
break 1 10:00:00 to 10:30:00
break 2 18:00:00 to 18:30:00
break 3 02:00:00 to 02:30:00

End Time Start time
07:23:12 - 06:23:12 = 01:00:00
12:10:23 - 08:10:23 = 03:30:00
19:15:00 - 15:15:20 = 03:30:00
20:10:23 - 08:10:23 = 09:00:00
04:25:10 - 08:25:10 = 18:30:00

any ideas on a formula

thanks

kevin