Your syntax error is because you are missing some right parenthesis in your expression. But you do not need the second If function in the example given.
Case ( BoxA > 80 and BoxB< 90 And ContainerA > 120 And ContainerB < 150 ; "Perfect" ; "Not Perfect" )
But your expression looks unusual. Are you sure that you actually have 4 different fields to test here and not just two?
I have 4 sets of ranges to test.
BoxA >90 and BoxA<110 AND ContainerA>150 and ContainerA<180
BoxA >110 and BoxA<120 AND ContainerA>180 and ContainerA<190
Etc, each with different TEXT results.
Yikes, you are correct, just TWO, not 4... Brain Fart
Sorry about that.
Would that be two different results or 4?
Case ( BoxA >90 and BoxA<110 AND ContainerA>150 and ContainerA<180 ; "Result 1" ;
BoxA >110 and BoxA<120 AND ContainerA>180 and ContainerA<190 ; "Result 2" ;
"Result 3" // This is the "else" result returned when none of the two Boolean expressions are True
Case functions start with the first Boolean expression and returns the corresponding result of the first one to evaluate as True
PS, you probably need some < operators here as the values BoxA = 110 and ContainerA = 180 will produce "Result 3" if you don't use them here.
Forgot all about CASE function. Yes, this works perfect, thanks! As always, greatly appreciate your help.
You are correct about < in the above example.
Thanks, tested a sample of the code and it works. Should have thought of this myself.
PS: to answer your question, for every line of code, you get one result. in your example, the return would be 2 results. Result 3 would return a false result as you noted above. Correct as you interpreted it. Thanks.