Oct 24 2021 11:35 PM
Hi all,
I'm a novice in Excel so go easy on me, but this little thing has me pulling out my hair!
I'm creating a scatter chart using error bars to draw between the scatter markers, so I need to take my (simple) data and create a positive or negative error value to determine the length of the line:
Positive
=IF(A3-A2>0,(A3-A2),0)
Negative
=IF(A3-A2<0,ABS(A3-A2),0)
The problem I have is that I don't want any error bars when 'A3' equals exactly 0. The positive formula is fine, but the negative one, of course, will still return a value (0 - 'A2').
I've tried a bunch of different "AND" and "NOT" things, and other nested IF statements, but I'm clearly missing something pretty simple here!
So, basically, is there a way of saying:
If (A3-A2)<0, return the absolute value of (A3-A2), otherwise return 0, UNLESS A3 is exactly 0, in which case always return 0?
Thanks in advance!
Oct 25 2021 12:32 AM
SolutionFor example
=IF(A3=0,0,IF(A3-A2<0,ABS(A3-A2),0))
or
=IF(OR(A3=0,A3-A2>=0),0,ABS(A3-A2))
Oct 25 2021 12:37 AM - edited Oct 25 2021 12:38 AM
@joeexception You're a novice. I'm not a clairvoyant but perhaps theses will do what want:
Positive: =IF(A3=0,0,IF(A3-A2>0,(A3-A2),0))
Negative: =IF(A3=0,0,IF(A3-A2<0,ABS(A3-A2),0))
Or perhaps you can combine both into one:
=IF(A3=0,0,IF(A3-A2>0,(A3-A2),ABS(A3-A2)))
Ooops: Didn't see the first response until I posted mine.
Oct 25 2021 12:39 AM
Oct 25 2021 12:41 AM
Oct 25 2021 01:14 AM
Oct 25 2021 12:32 AM
SolutionFor example
=IF(A3=0,0,IF(A3-A2<0,ABS(A3-A2),0))
or
=IF(OR(A3=0,A3-A2>=0),0,ABS(A3-A2))