I have a problem that I just can't seem to get my brain around at the moment, and I'm hoping for some inspiration from here.
Flash Gordon records his duty time in a row on a spreadsheet with the following columns
(A) Date (B) Start Time (C) End Time (D) Duty Time (Calculated as (C)-(B)) (E) Rest Day
01-07-2013 09:00 11:00 02:00 Work
02-07-2013 00:00 00:00 00:00 Rest
03-07-2013 10:00 20:00 10:00 Work
04-07-2013 09:30 17:30 08:00 Work
05-07-2013 10:00 19:57 09:57 Work
06-07-2013 11:00 18:55 07:55 Work
07-07-2013 00:00 00:00 00:00 Rest
08-07-2013 00:00 00:00 00:00 Rest
09-07-2013 10:00 16:00 05:00 Work
Now, I now this is going to be an easy one to solve, the answer is staring me in the face but I just can't see it.
I need to know that when Flash went to work at 10:00 on 09-07-2013 how much time has elapsed since the last time he was at work. There may be periods of the year when Flash returns to Earth for his annual vacation so a nested IF(... would be an inelegant way to resolve the issue, especially as his journey home may take upto 28 days! There is further data in the columns to the right which means not having rest days recorded isn't an option - in which case the answers would be quite easy to get to. Once I have the logic for this I will be able to switch it to look at how much he has worked etc
I've played around with DMAX, DSUM etc but I can't quite seem to get the "criteria" to work the way I need it to.
What little hair I have left is about to be pulled out.
Any help or guidance would be much appreciated.
Thanks
Ming
Bookmarks