title: Sum until value reached then stop
body: <p>I have honestly and sincerely gone through a good number of questions regarding this topic, but none seem to exactly hit the mark for my issue (due to my lack of knowledge, obviously). </p>
  
  <p>In any case, I work in insurance and currently working on a program with a loss aggregate limit of USD 10 mln in the year. So the table on the left in the attached snapshot shows the incidents(losses) during that day of the month (going down) during that year (going across). What I would like to do in the table on the right is to tell it to sum losses until USD 10 mln is reached then set all remaining losses for the remainder of the year to zero (I have months in consecutive order with subtotals for the months in between). </p>
  
  <p>To be clearer, for example, January 11th, 2017 should read USD 9,772,760 since there was a USD 227,240 loss on January 1st, 2017 (combined would be USD 10 mln) and therefore would exclude the January 26th loss of USD 222,582 or any following losses for the rest of the year (set to 0).</p>
  
  <p>Hope I'm clear, and I hope I'm not breaking any protocols by posting this as is. 
  <img src="https://i.stack.imgur.com/2jXGD.jpg" alt="enter image description here"></p>
  
  <p><a href="https://i.stack.imgur.com/SgFQt.jpg" rel="nofollow noreferrer">Example no.2</a></p>