Forum Discussion

Ross_Murphy's avatar
Ross_Murphy
Copper Contributor
Apr 04, 2021

How to make a formula only apply when the result is not a negative number

Ok, I am new to Excel (or rather I haven't used it since school), so this may be a very basic question.

 

Basically I need a formula that outputs a result for one cell with reference to two other cells. But I need it to ignore one of the cells, if that cell has a positive number.

So give an example with the data I'm working with...

 

D4 is 16

F4 is 7

W4 is =TRUNC(D4/2,0)-5

X4 is =TRUNC(F4/2,0)-5

 

O4 is =2+W4+X4

 

D4 and F4 are starting numbers, W4 and X4 derive modifiers from it and O4 then calculates a different value by adding those together and then adding 2 to it.

 

This works fine. But I need it to change if X4 is a positive number. In that case I need it to not add in positive numbers at all, I need it to only add negative results.

 

X4 becomes a positive number whenever F4 is 10 or above. So I need it stop applying the addition when that is the case.


I may not be explaining this very well, but hopefully you will understand. Or ask me to clarify if you don't.
Thanks.

Resources