Forum Discussion
joeexception
Oct 25, 2021Copper Contributor
Ignoring zero in IF formula
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 tak...
- Oct 25, 2021
For 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))
Riny_van_Eekelen
Oct 25, 2021Platinum Contributor
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.
joeexception
Oct 25, 2021Copper Contributor
Thanks Riny - Hans got in just before you 😉
Too many clever boffins on this site
Too many clever boffins on this site