bimi82
Contributor

Nested IF's and Or's > validating multiple dropdown options

Jump to solution

Hello

 

I have 5 seperate dropdown options which allows you to select 1 to 5 range.
My idea is to come up with a EndResult depending on the selected options.

 

The criteria to meet the EndResult: X | Y | Z

 

X means if Option1 is either 4 or a 5

Y means if Option1 is either 2 or 3 AND Option3 is 4 or 5

Z means if Option1 is either 3 or 2 or 1 AND Option3 is either 3 or 2 or 1 AND Option5 is either 4 or 5

 

Anything else outside the above range is "Normal"

 

How to do that? It requires nested IF statements and I get lost in it.

My initial start ... :

 

if(or(Option1=="4", Option1=="5"),"Big", "Normal")

 

Would appreciate your advise.

Tags (2)
0 Kudos
Reply
6 Replies
bimi82
Contributor

Re: Nested IF's and Or's > validating multiple dropdown options

Jump to solution
if(or(Option1=="4", Option1=="5"),"X", "Normal")
0 Kudos
Reply
bimi82
Contributor

Re: Nested IF's and Or's > validating multiple dropdown options

Jump to solution

Anybody can assist?

I got the 1st and 2nd option fixed.

 

X Option

if(or(parseLookup(Q1_Option)=="4", parseLookup(Q1_Option)=="5"),"X Option", "Normal")

 

 

Y Option

if(and(or(parseLookup(Q1_Option)=="2", parseLookup(Q1_Option)=="3") , or(parseLookup(Q3_Option)=="4", parseLookup(Q3_Option)=="5")),"Y Option", "Normal")

 

Z Option

This is where I am struggling .... the or() & and() seem to look at only two possible outcomes.

How do I nest that above to match the Y criteria?

 

0 Kudos
Reply
MegaJerk
Collaborator

Re: Nested IF's and Or's > validating multiple dropdown options

Jump to solution

How are you displaying the results? Inside of a Calculated Control perhaps? 

Is it supposed to return the String "X", "Y", or "Z" based on your formula? 


0 Kudos
Reply
SimonMuntz
Nintex How-To Center Expert
Nintex How-To Center Expert

Re: Nested IF's and Or's > validating multiple dropdown options

Jump to solution

Hi,

 

I gave this a go and this is what I came up with:

If(op1>3,"X",(If((op1>1 && op1<4)&&(op3>3),"Y",If(((op1>0) && (op1<4))&&((op3>0) && (op3<4))&&(op5>3),"Z","Normal"))))

I could have used runtime functions through out the formula but it would have been 10 times longer.

Attached a demo form showing this working.

Reply
bimi82
Contributor

Re: Nested IF's and Or's > validating multiple dropdown options

Jump to solution

@MegaJerk 

 

Correct, I am using a calculated formula within the form.
Since, I was strugling to get everything working in one calculcated value ; instead I have added three fields for X Y Z in this example

 

So, the first two X and Y fields work fine and now struggling with Z option as I cannot it to work when three condition meet e.g. when Option 1 and 2 and 3 meet the criteria.

 

 

0 Kudos
Reply
bimi82
Contributor

Re: Nested IF's and Or's > validating multiple dropdown options

Jump to solution

@SimonMuntz 

 

Excellent, works like butter on toast :)
I could not have come up with that formula, by myself.

 

Cheers

0 Kudos
Reply