title: Subtract value in one cell until it reaches zero before subtracting value from another
body: <p>B9 <code>=IF(H6,C6,0)-f9</code>
  C9 <code>=$A$2-E6</code>
  D9 =(NEED HELP)</p>
  
  <p>Is there a formula I can put in D9 OR maybe just add to B9 and C9 (still need the above formulas) that will deduct B9 value until it reaches zero BEFORE deducting from C9 when I enter amount in F9?</p>
  
  <p>Example:</p>
  
  <p>B9 has 150 based on the above formula
  C9 has 200 based on the above formula
  D9 is the total of B9&amp;C9 350 (This column may not be necessary)
  F9 is where I would put in a number so say I put in 175. B9 should now say 0 and C9 should now say 175.</p>