Thread: total hours
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default total hours

Try this.

I'm assuming that the date in D will never be less than the date in C.

=IF(AND(C1=D1,B1<A1),0,((B1+D1)-(A1+C1))+(B1+D1<A1+C1)*(D1-C1))

Format as [h]:mm

--
Biff
Microsoft Excel MVP


"ekkeindoha" wrote in message
...
Good day,
I would like to get help on the following.
A B C D
19:00 16:00 21jul 21jul
19:00 08:00 21jul 22jul

If it occurs that the date on C and D are the same and the time on B are
earlier than time on A it should be 0.
If time on date on C and D are the same an time on B are later than time
on
A it should give the difference.
My main concern are if the date on D are later than C to get the
difference
between B and A as it should be 13hours.