title: Calculating every n-th row with a different format
body: <p>I'm trying to make a formula work on a time-table, <strong>where every 7th row I have a sum of the work-time for a week and then I want them to sum them altogether from beginning of data to current week</strong>.</p>
  
  <p>Technically it is possible to just manually add them together, but I would like to have it automated and furthermore to learn how to use the function properly.</p>
  
  <p>Screenshot for better visualization:</p>
  
  <p><a href="https://i.stack.imgur.com/dIcys.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dIcys.png" alt="enter image description here"></a></p>
  
  <p>In the column "Nadcas" I have listed overtimes from Monday to Tuesday.
  Under it is a SUM of those numbers. Right to it, the second highlighted field is the Overtime total. Logically, the first week is going the total of the overtimes to be the same as overtime of the first week.</p>
  
  <p>In the table under it, it's the same deal. However, the overtimes on the right are calculated incorrectly. It should be 0:29 + 1:32 = 2:01. </p>
  
  <p><strong>Biggest issue is, the sumtotal formula doesn't correctly calculate, when the field type is in hours, and some are text fields</strong></p>
  
  <p>Any idea how to do it?</p>
  
  <hr>
  
  <p><em>OPTIONAL, can skip if you know the answer</em>:<br>
   I have found a way to make the formula work, in the table here:</p>
  
  <p><a href="https://i.stack.imgur.com/3ATjo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ATjo.png" alt="enter image description here"></a></p>
  
  <p>You can see the numbers are added up correctly. The formula I used (for the last sum cell, that equates to 11) is:</p>
  
  <p><code>=SUMPRODUCT(--(MOD(ROW(A12:A23) - ROW(A12) +1; 4)=0); A12:A23)</code></p>
  
  <p>Sum product does a matrix multiplication, mod returns 1 or 0 depending if X/4 gives .0 as rest and -- negates the result. Easily said, we have two matrices eg. {0; 0; 1} and {1; 2; 3} so the result is 0x1 + 0x2 + 1x3 = 3.</p>
  
  <p>When we visualize that on our formula, it would look like:</p>
  
  <p><a href="https://i.stack.imgur.com/ebJLu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ebJLu.png" alt="enter image description here"></a></p>
  
  <p>[ For more info, I found this explanation pretty helpful, even though it's for columns. <a href="https://exceljet.net/formula/sum-every-nth-column" rel="nofollow noreferrer">https://exceljet.net/formula/sum-every-nth-column</a> ]</p>
  
  <p>This should by all means work on the main table as well, but I guess because of formatting it doesn't. </p>