The Other Worlds Shrine

Your place for discussion about RPGs, gaming, music, movies, anime, computers, sports, and any other stuff we care to talk about... 

  • Louis, about that supervisor shift overlapping

  • Somehow, we still tolerate each other. Eventually this will be the only forum left.
Somehow, we still tolerate each other. Eventually this will be the only forum left.
 #128770  by SineSwiper
 Sat Nov 08, 2008 5:25 pm
I overheard Shellie talking about that overlapping shift spreadsheet thing you were doing. When I heard you were doing it with true/false statements every 30 minutes, I was thinking that there's got to be a more mathematical way.

Well, I was bored waiting at the haircutting place, so I figured it out. Okay, given any two shifts, the amount of overlap is going to be:

(Earlier end time) minus (Later start time)

So, if you have a shift like these:
Code: Select all
|---------------------|
              |---------------------|
The overlap visually is obvious. Mathematically, it's always going to be the first ending time minus the last starting time. In Excel, where A/B is the start/end times, and 1/2 is the shifts, this would be:

=IF(B1 < B2, B1, B2) - IF(A1 > A2, A1, A2)

In the case of a "tie", 1 or 2 will be the same, so it doesn't matter. The only other thing to consider is if the overlap doesn't exist at all. If that's the case, it will be negative. So, there's a MAX function in Excel. Make it either the formula or zero, whichever is higher.

As far as individual days, I'm not sure, but ultimately, you'll be adding all of those together. You will also need to account for 3rd shifts, but if the dates are complete times and dates, Excel will fix part of the problem for you.

 #128773  by Flip
 Sat Nov 08, 2008 5:39 pm
This could have been handled via PM.

 #128776  by Louis
 Sat Nov 08, 2008 5:49 pm
That is more or less what I was doing, albeit your formula is much more simplistic. Right now I'm just trying to come up with a way to account for schedules that go past midnight. At that point my blood pressure started to rise and I got a migraine because the call center was in a queue and I never came back to it.

Since I don't have anything better to do for the next hour or so I'm going to start toying with it again.

 #128780  by Tessian
 Sat Nov 08, 2008 8:21 pm
That reminds me-- Bovine, I just found out I have the clap, you should get yourself tested

 #128781  by bovine
 Sat Nov 08, 2008 8:59 pm
Tessian wrote:That reminds me-- Bovine, I just found out I have the clap, you should get yourself tested
oh jeeze

 #128782  by Eric
 Sat Nov 08, 2008 9:01 pm
Heya James, those Obshina Mafia dudes we ripped off for $250,000 are looking for us, I don't think they know if they know about this place yet but I think you better watch your back.

 #128783  by Lox
 Sat Nov 08, 2008 9:16 pm
I pooped today and there was corn in it. The scary thing is...I haven't eaten corn in 2 weeks.