
Originally Posted by
MrShorty
Assuming that the dates and times in B, C, and row 1 are stored as numbers and not text, then number formatting won't matter to the calculation scheme. I would expect to do something like.
1) Extract time from the Clear date time (column C), compare to the time in row 1 one column to the right (this probably means you will need a 24:00 entry in AC1), and take the smaller of the two MIN(MOD($C2,1),F$1)
2) Extract time from the call date time (column B), compare to the time in row 1 (same column), and take the larger of the two. MAX(MOD($B2,1),E$1).
3) Subtract 2 from 1 MIN(...)-MAX(...)
4) When an hour is not included in the times in B and C, then this difference will be less than 0. Force it to never return a value less than 0 =MAX(0,MIN(...)-MAX(...))
Note the mix of relative and absolute references and copy/paste/fill down and across.
Will that work for you?
Bookmarks