cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

AND/OR statements in Formula Editor

EH1
EH1
Level III

Hi All,

 

I was hoping someone could help me with a formula containing AND/OR statements.  I have written a formula in "Column 5" based on the results of 3 other columns: Run F, Run M, and Run S.  The portions of the formula that only contain IF/THEN statements produce the desired results.  However, the portions of the formula that also contain AND/OR statements do not work (non-working portions of the formula are circled in RED in the attached screen shot).  The JMP file is also attached below.  Can anyone please help on what I am doing wrong?

 

Thank you!

Erica

 

Screen Shot 2021-07-12 at 10.06.06 AM.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User


Re: AND/OR statements in Formula Editor

Try this form and see if the logic works correctly

If(
	:Run F == 1 | :Run M == 1, "Leave",
	:Run F == 2, "Keep",
	:Run F == 3, "Upscale",
	(:Run F == 4 | :Run F == 5) & (:Run S == 1 | :Run S == 2), "Fix",
	(:Run F == 4 | :Run F == 5) & (:Run S == 3 | :Run S == 4), "Encode",
	:Run M == 2, "Upscale",
	:Run M == 3 & (:Run S == 1 | :Run S == 2), "Fix",
	:Run M == 3 & (:Run S == 3 | :Run S == 4), "Encode"
)
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User


Re: AND/OR statements in Formula Editor

Try this form and see if the logic works correctly

If(
	:Run F == 1 | :Run M == 1, "Leave",
	:Run F == 2, "Keep",
	:Run F == 3, "Upscale",
	(:Run F == 4 | :Run F == 5) & (:Run S == 1 | :Run S == 2), "Fix",
	(:Run F == 4 | :Run F == 5) & (:Run S == 3 | :Run S == 4), "Encode",
	:Run M == 2, "Upscale",
	:Run M == 3 & (:Run S == 1 | :Run S == 2), "Fix",
	:Run M == 3 & (:Run S == 3 | :Run S == 4), "Encode"
)
Jim
EH1
EH1
Level III


Re: AND/OR statements in Formula Editor

That works perfectly!!  Thank you so much, Txnelson!!  I greatly appreciate your help!!

Recommended Articles

No recommendations found