A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Just use a addition, =A1+B1.If B1 < 0, the formula is the same as A1-B1. If B>=0, the formula is the same as A1+B1. Or am I missing something?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Can anyone let me know the best formula for subtracting and adding positive/negative numbers. Basically I want the formula to subtract everytime there's a negative number (i.e -2) and add everytime the value is positive (i.e 2). I know this seems easy, but the tricky part here is that the cell the result depends on identifies the value as positive or negative. Anyways, can anyone help, I can't figure out the best way to automate this.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Just use a addition, =A1+B1.If B1 < 0, the formula is the same as A1-B1. If B>=0, the formula is the same as A1+B1. Or am I missing something?
What if
A1=0
A2=-3
Because i am getting the return value as 3.
Please help me.
Adding a negative number is the same as subtracting the absolute value of that number. A1-B1 when B1 is negative is the same as A1+ABS(B1) where ABS(B1) is the postive value of B1. ABS, or Absolute Value returns the positive value of any positive or negative number. This is basic arithmetic from grammar school.
Can you provide some sample values and the result you want when adding or subtracting them?
When I put in 2 numbers and try to subtract the negative number, it adds them together. I do not know in advance if the number will be positive or negative. I just want to put in the numbers and have them subtract. Can't seem to do this.
Does anyone know what I'm doing wrong?
Put a bunch of numbers in A1:A8 - make some of them negative. In B1 enter =SUM(A1:A8)
If this does not answer your question please explain more. best wishes