Formula for spreading a currency addition/subtraction across two different columns?

Say I have 3 columns: A B C
-In column A, I will be inputting positive and negative currency values (e.g., $500 or -$500)
-Column B will contain a running balance for Account Alpha (say the balance is $500)
-Column C will contain a running balance for Account Bravo (say the balance is $2,000)

If I input into Column A the following: -$700, is there a way to create a formula that will balance Column B and Column C why subtracting the maximum possible from Column B and once zero is reached, subtracting any outstanding remainder from Column C? The final breakdown would look like this:

A B C
$500 $2,000
-$700 $0.00 $1,800

How do I create an IF statement to act on two different events?

For example, I am trying to command:
IF D5 is > zero, then sum G4 and D5
and IF F5 = zero, then sum G4+(E5+F4)

How do I write this formula?

My attempt below does not work:

=IF(D5>0, G4+D5, IF(F5=0,G4+(E5+F4)))

Your attempt is read as:

IF(D5>0, 
    Then G4+D5, 
  ELSE
     IF(F5=0,G4+(E5+F4)))
  END

So your second IF is checked, when D5 is NOT >0
.
I guess you may asked for

=IF(D5>0, 
       IF(F5=0,G4+(E5+F4), 
                      G4+D5 ))

but this has no provisions for the else-part…
.
Another way to combine conditions is IF( AND(D5>0; F5=0) , then-part , else-part )

AI says :

I was able to make Column C work (if Column B is at $0) with this formula: =IF(E7=0,F6+(D7+E6))

Where this formula fails is if Column B is not zero.

How do I specify to copy down the cell above if Column B is not zero. Example:

A            B             C
            $500        $2,000
+$100       $600        $2,000
-$700       $0          $1,900

I can successfully arrive at $19,00 in C3. But I cannot successfully arrive at $2,000 in C2.

I’d assume your formula is not even related to your question, as I don’t see A,B and C in the formula =IF(E7=0,F6+(D7+E6))
Or maybe you didn’t tell about the relation.

It seems that AI made an error. Cell C2 should contain =C1+A2-(B2-B1), that is reversed for B1 and B2.

Cell B2 is OK at =MAX(0,B1+A2)

2 Likes

IFS function