title: How to check if cell value is greater than X, get the difference from those 2 values and add to the next cell in Excel?
body: <p>I have an excel problem I really need help with! 
  I want to use functions in column Day1 and Day2. 
  Goal: To check each cell and make sure it doesn't exceed 27. If it does, get the difference between the cell value and 27, carry over the difference and add to the next cell. </p>
  
  <p>Example, in column Day1, it will check if 13 is greater than 27. It's not so it will leave that value as it is. Same with 14 and 26. The next value in Day1 Column is 29 which is greater than 27, so it will change that cell value to 27 and carry over the difference (29-27)=2 and add to the cell below so 31 + 2 = 33. Now 33 is greater than 27 so it will again change that value to 27 and carry over the difference (33-27) = 6 and add it to first cell in Day2 Column: 6 + 5=11.</p>
  
  <p>The process will be repeated for Day2 column as well. If the last value in Day2 column doesn't exceed 27, then leave as it is. Move to the next column and repeat that process of checking if cell value is greater than 27. </p>
  
  <p>Current:</p>
  
  <pre><code>Time    Day1 Day2
  Hour0   13   5
  Hour1   14   15
  Hour2   26   29
  Hour3   29   26
  Hour4   31   4
  </code></pre>
  
  <p>Desired: </p>
  
  <pre><code>Time    Day1 Day2
  Hour0   13   11
  Hour1   14   15
  Hour2   26   27
  Hour3   27   27
  Hour4   27   5
  </code></pre>
  
  <p>Now I'm not an excel expert so I tried few if statements but don't think that is the way to solve this problem. I did, <code>if(A1&gt;27, 27, A1)</code> which is checking if A1 is greater than 27, change that value to 27 else leave that value as it is. But then I also need another if statement, <code>if(A1&gt;27, A2=(A1-27) + A2, A1)</code>
  Trying to find a way to combine those 2 if statements or are there other excel functions/secrets that I can use?
  Please any help is appreciated. 
  Thanks!!</p>