Support Board
Date/Time: Tue, 21 May 2024 01:29:32 +0000
Post From: False positives using IF statement
[2020-03-06 14:09:23] |
Sawtooth - Posts: 4002 |
Upon closer look at that formula, it won't change to the opposite polarity until B3 has made the full transition to the other side, so there will be some false positives in between. You could just use two columns: =IF(AND(B3>ID11.SG1@3,B3>ID12.SG1@3,B3>ID15.SG1@3),1,0) =IF(AND(B3>ID11.SG1@3,B3>ID12.SG1@3,B3>ID15.SG1@3),-1,0) If you want the formula in only one column, you'll need a third condition, rewritten using MAX and MIN functions: =IF(AND(B3>=MIN(ID11.SG1@3,ID12.SG1@3,ID15.SG1@3),B3<=MAX(ID11.SG1@3,ID12.SG1@3,ID15.SG1@3)),0,IF(B3<MIN(ID11.SG1@3,ID12.SG1@3,ID15.SG1@3),1,IF(B3>MAX(ID11.SG1@3,ID12.SG1@3,ID15.SG1@3),-1,U4))) |