title: How to Create a List of Available Times after removing Downtimes from a Period
body: <p>I have a grid which lists the Period (Start - End), and a list of Downtimes.</p>
  <p>The downtimes are then sorted (to ensure chronological order based on the start time of the outage), using the following formula:</p>
  <p><code>=SORT(INDIRECT(&quot;B4:C&quot;&amp;SUMPRODUCT(MAX((B4:B12&lt;&gt;&quot;&quot;)*ROW(B4:B12)))),1)</code></p>
  <p>After which I am trying to calculate the list of Available times (Uptimes).</p>
  <p>Currently i have a mess of inflexible formulas as follows:</p>
  <p>B26 <code>=IF(B14&lt;B15,B14,C15)</code></p>
  <p>C26 <code>=IF(C14&lt;C15,C14,B16)</code></p>
  <p>B27 <code>=C16</code></p>
  <p>C27 <code>=B17</code></p>
  <p>I am searching for either a universal single celled arrayformula, or a formula that can be dragged (down/across), that can calculate the list of Available times (Uptimes).</p>
  <p>I am seeking formula solutions that will work in <strong>both</strong> Excel (Mac 2021) <strong>and</strong> Google Sheets.</p>
  <p>See attached image:
  <a href="https://i.stack.imgur.com/jPQTv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jPQTv.png" alt="enter image description here" /></a></p>
  <p>EDIT:</p>
  <p>Here is a google sheet that has some example data, and explanatory notes: <a href="https://docs.google.com/spreadsheets/d/1t0XImtjP4RKeTdg3L97bjPzateUX2waHPhjf3nmSFIk/edit#gid=2100307022" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1t0XImtjP4RKeTdg3L97bjPzateUX2waHPhjf3nmSFIk/edit#gid=2100307022</a></p>