- If two or more of the four Yes/No parameters are checked, the value of TEXT is to be "SELECT ANY ONE".
- If none of the four Yes/No parameters are checked, the value of TEXT is to be "NO TEXT".
- If only the A parameter is checked, the value of TEXT is to be "A".
- If only the B parameter is checked, the value of TEXT is to be "B".
- If only the C parameter is checked, the value of TEXT is to be "C".
- If only the D parameter is checked, the value of TEXT is to be "D".
The solution I devised uses a series of nested if statements to work through all of the possibilities. The condition of the first if statement is an or. Each item in the or is an and of a pair of the Yes/No parameters. There is an and for each possible combination of the four Yes/No parameters. If both items in at least one of the combinations of Yes/No parameters is true, then the entire or evaluates to true. That takes care of all of the situations where two or more of the Yes/No parameters are checked, and "SELECT ANY ONE" is returned.
The else of the first condition then launches a series of if statements that tests whether a given Yes/No parameter is checked, starting with A. If A is checked, "A" is returned; if not, another if statement tests for a check in B. If B is checked, "B" is returned, and so on through to D. If D is checked, "D" is returned; if not, "NO TEXT" is returned.
Here is the formula:
if(or(and(A, B), and(A, C), and(A, D), and(B, C), and(B, D), and(C, D)), "SELECT ANY ONE", if(A, "A", if(B, "B", if(C, "C", if(D, "D", "NO TEXT")))))
And a screen capture:
1 comment:
thank you, you already helped me with this.
I did have a question: is it possible that when A is selected that B,C,D are automatically turned off?
Post a Comment