Hi,
I am struggling at getting this multiple if statement working but I am not sure if the method I am using is actually correct because as soon as it hits a certain if statement line and the answer is incorrect then it is giving the false value back instead of going to the next if statement.
I have 4 variables and the rule are:
Variable 1: Can either be Yes or No
Variable 2: Can either be Yes or No
Variable 3: Can be any number
Variable 4: Can be any number
Rule 1: IF variable 1 is Yes AND variable 2 is Yes AND variable 3 >= variable 4 then Do something;
Rule 2: IF variable 1 is Yes AND variable 2 is Yes AND variable 3 < variable 4 then Do something;
Rule 3: IF variable 1 is No AND variable 2 is Yes AND variable 3 >= variable 4 then Do something;
Rule 4: IF variable 1 is No AND variable 2 is Yes AND variable 3 < variable 4 then Do something;
Rule 5: IF variable 1 is Yes AND variable 2 is No then Do something; (this is because if variable 2 is No then it doesnt matter what variable 3 and 4 are, so do something now)
Rule 6: IF variable 1 is No AND variable 2 is No then Do something; (this is because if variable 2 is No then it doesnt matter what variable 3 and 4 are, so do something now)
The way I have done this is, if v1 and v2 are both yes and if v3<v4 then do an action by outputting "rule 2 met", else output "rule 1 met"
The same goes for the other rules but if I change the variable 2 to No then it does not meet the condition:
I think I am approaching this wrong, I think I need a if then elseif if its possible in excel?HTML Code:
Bookmarks