Subtract value in one cell until it reaches zero before subtracting value from another

2.2k Views Asked by At

B9 =IF(H6,C6,0)-f9 C9 =$A$2-E6 D9 =(NEED HELP)

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?

Example:

B9 has 150 based on the above formula C9 has 200 based on the above formula D9 is the total of B9&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.

1

There are 1 best solutions below

2
On

It's basic math:

B9 +C9 -F9 =175
150+200-175=175

Just add another column. However you cannot put the result in B9.

That is called a circular reference, which is the same idea as saying:

"I am one year older than you, and you are one year older than me."

You can, however, use one of mpore additional cells/columns, to display your result, like G9, and hide any columns that you don't want to display.

img