title: Count number of overlapping minutes between two timedate ranged
body: <p>I have an excel spreadsheet whereby I have an event start and end date. I want to produce a number of minutes result grouped by a date range. The result will be 8 hour chunks, for example I want to know how many minutes of the event are in the range:
  15:00 until 23:00,
  23:00 until 07:00, 
  07:00 until 15:00.</p>
  
  <p>So an event which starts at 16:00 and finishes at 23:30 ( 7 hours 30 minutes total length ) would fit into the 15:00 - 23:00 and have a value of '7' hours. The event would also have 0.5 result hours in the 23:00 until 07:00 group.</p>
  
  <p>here is an example screenshot of what I have, and what I expect the values to be</p>
  
  <p><img src="https://i.stack.imgur.com/O7gqS.png" alt="enter image description here">
  What sort of formula do I need to put into my three grouped time range cells to get the results I want? ( use columns A-G for reference ).</p>
  
  <p>Thanks</p>
  
  <p>Edit: copy/paste of an example spreadsheet:</p>
  
  <p><a href="http://jsfiddle.net/QJ9vX/" rel="nofollow noreferrer">link to example spreadsheet for copy paste</a></p>
  
  <p>Just copy the output table js fiddle has created and paste into excel.</p>
  
  <p>Raw code:</p>
  
  <pre><code>start   end duration    minutes dur 15:00 until 23:00   23:00 until 07:00   07:00 until 15:00
  08/12/2013 14:15    08/12/2013 17:15    03:00   180         
  08/12/2013 12:00    08/12/2013 15:00    03:00   180         
  08/12/2013 11:30    08/12/2013 14:10    02:40   160         
  08/12/2013 11:30    08/12/2013 14:10    02:40   160         
  08/12/2013 00:00    08/12/2013 03:00    03:00   180         
  07/12/2013 19:45    08/12/2013 02:00    06:15   375         
  07/12/2013 17:15    07/12/2013 20:15    03:00   180         
  07/12/2013 14:55    07/12/2013 17:55    03:00   180         
  07/12/2013 14:30    07/12/2013 17:10    02:40   160         
  07/12/2013 14:30    07/12/2013 17:10    02:40   160
  </code></pre>