Calculation on multiple choice question

The question is multiple choice with 4 options (option-1, option-2, option-3, option-4)

Calculation- If option-1 or option-2 is selected in the question then code 0 should be given, if option-1 and option-2 are selected in the question then code 1 should be given, if option-1 and option-3 are selected in the question or option-2 and option-3 are selected or option-1 and option-2 and option-3 are selected then code 2 should be given, if option-1 and option-4 are selected in the question or option-2 and option-4 are selected or option-1 and option-2 and option-4 are selected then code 3 should be given.

If option-1 or option-2 is selected in the question then code 0 should be given, if option-1 and option-2 are selected in the question then code 1…

This is strictly speaking somewhat ambiguous [if the statement “option-1 and option-2” is true, then logically the statement “option-1 or option-2” is also true…]. I might recommend writing down all the permutations in a truth table, along with their desired outcome, and from this constructing a suitable nested if() statement (ala Nested if statements - #6 by khalid_amarkhail1) for the appropriate calculation.

1 Like