Trying to write this conditional statement, but getting error ..Malinformed IF statement ...
IIF(OR(&&( [Plant2]=[Row+1:Plant2],[Plant2]=[Row-1:Plant2],[Stock Without IT] <= [Row-1:Stock Without IT],[Stock Without IT] <[Row+1:Stock In Transit ]),&& ([Plant2]=[Row-1:Plant2],[Stock Without IT] <= [Row-1:Stock In Transit ]), &&([Plant2]=[Row+1:Plant2],[Stock In Transit ]<[Row+1:Stock In Transit ])),[Stock In Transit ],NULL())
Solved! Go to Solution.
Try this:
IIF((([Plant2]=[Row+1:Plant2] && [Plant2]=[Row-1:Plant2] && [Stock Without IT] <= [Row-1:Stock Without IT] && [Stock Without IT] < [Row+1:Stock In Transit ]) OR ([Plant2]=[Row-1:Plant2] && [Stock Without IT] <= [Row-1:Stock In Transit ]) OR ([Plant2]=[Row+1:Plant2] && [Stock In Transit ]<[Row+1:Stock In Transit ])),[Stock In Transit ],NULL())
Unlike the typical syntax used in Excel etc., the && (and) and OR statements need to be between clauses rather than preceding a list of clauses in parentheses. For example, (A = B && B > C) rather than AND(A=B,B>C)... same with OR statement, which would be (A=B OR B=C). Note that you can also use two pipe delimiters || to signify OR.
Hope that helps!
NJ
Thanks Nicole! That helped.