Reputation: 85
How to create Excel formula that adds a cell if it's negative or subtracts it if it's positive?
I understand I can use simple forumlas like =A37+D35
or =A37+SUMIF(D35,"<0")
if I already know which direction the formula should go (adding or subtracting), but...
how do I get the formula to figure that out for me?
I want to say: "If D35 is negative ADD it to A37, BUT if it's positive SUBTRACT it from A37".
Upvotes: 0
Views: 1833
Reputation: 1789
You can just make the field negative and it will automatically flip the sign.
=A37-D35
If D35 is negative, the double negative turns to positive.
Upvotes: 1