# Calculate using IF Statement

#### christianbiker

##### Active Member
I want to set up a basic spreadsheet in order to track account activity for our club. The columns I have set up to track the actual money are as follows:
Amount Debited
Amount Credited
Balance

I want it to be an ongoing calculation that will automatically add/subtract based on where the amount fall. It it falls into the debited column i want it automatically removed from the balance column, and if it falls into the credited column i want it to autmatically add to the balance column.

I came up with this formula to minus:
=IF(C6>0, C6+E5, "")

but when i add another IF statement like this in order to add i get an error:
=IF(C6>0, C6+E5, ""), IF(D6<0, E5-D6, "")
it gives me #VALUE.

How do i get around this?

Thanks.

### Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

#### kkknie

##### Well-known Member
I think you just missed it by a smidge... Try

=IF(C6>0,C6+E5,IF(D6<0,E5-D6,""))

The way the nested if works is:

If (Condition1, Then Sum, Else If (Condition2, Minus, Else Nothing))

Note that if both conditions are true, only the first one will be evaluated.

Hope this helps,

K

#### priddyboy

##### Board Regular
I can't tell what your best options are without seeing your sheet, but try this to combine the two formulas:

=IF(C6>0, C6+E5,IF(D6<0, E5-D6, ""))

#### christianbiker

##### Active Member
got it...thanks, much appreciated. i figured it was something simple like that.

Replies
4
Views
363
Replies
3
Views
488
Replies
1
Views
518
Replies
0
Views
318
Replies
14
Views
455

1,171,158
Messages
5,874,103
Members
433,024
Latest member
ostosix

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back