# Excel 2013 - Subtract from cell 2 negative value in cell 1, but only if cell 1 is negative.

#### Max99000

##### Honorable
I need to subtract from the "Savings Account" to make the "Current Account Bank Balance" 0 (ZERO) only IF the "Current Account Bank Balance" is negative, otherwise not. Also, if the negative balance of "Current Account Bank Balance" is greater than the positive balance of "Savings Account" subtract the entire savings value even if it "Current Account Bank Balance" does not = 0.

Thanks!

screenshot here: #### noidea_77

##### Honorable
The integrated Help function of Excel may help you with this homework. You will find some examples on how to use the IF function there.

#### Max99000

##### Honorable
Can anyone help me with the formula. I have no idea what to do. I have tried IF and SUMIF functions but I could not get it to work.

#### USAFRet

##### Illustrious
Moderator
Post an example of your IF statement. It does work.

#### Max99000

##### Honorable
OK. This should calculate "I4" considering the Account Balance:

=IF((G4+H3)<0,(I3+C4)-(G4+H3),(G4+H3))

but it does not work.

#### noidea_77

##### Honorable

";" instead of ","? And what's the Excel comment (behind the red rectangle) in column H? A format problem?

#### Max99000

##### Honorable
What do you mean by ";"?
The error says that I cannot use rotating variables.

#### Max99000

##### Honorable

Ingnore my last post. The error says "Inconsistent Calculated Column Formula", that's because I used different formulas in the rows.

#### Max99000

##### Honorable

Alright. I made some changes and I found a formula that could work. This will calculate cell "I13" "=IF((G13+H12)<0,(I12+C13)+(G13+H12),(I12+C13))" (screenshot below)
However, I need to make some changes because the formula will take the "Savings Account" on minus and that is not correct. I need it to make the "Current Account Bank Balance" positive, but only if there are enough savings. Otherwise, substract from savings as much as possible (until its 0), but not below 0. #### USAFRet

##### Illustrious
Moderator
Look into =SUMIFS

That allows multiple conditions.

#### Max99000

##### Honorable

How can I apply that to my spreadsheet? Can you give me an example please?
I'm a complete noob at this.

#### Max99000

##### Honorable
I found a solution.
The SUMIFS formula is not exactly what I needed. I used an IF statement combined with MAX formula.

Example:
To calculate I13 - =IF((G13+H12)<0,MAX(((I12+C13)+(G13+H12)),0),(I12+C13))

Thanks for the help guys!

Apps General Discussion 2
Apps General Discussion 2
Apps General Discussion 1
Apps General Discussion 5
Apps General Discussion 2
Apps General Discussion 5
Apps General Discussion 4
Apps General Discussion 1
Apps General Discussion 1
Apps General Discussion 37
Apps General Discussion 11
Apps General Discussion 15
Apps General Discussion 5
Apps General Discussion 1
Apps General Discussion 1
Apps General Discussion 1
Apps General Discussion 1
Apps General Discussion 1
Apps General Discussion 23
Apps General Discussion 2