Hello,
Please I am trying to create this condition in XLS form such that:
If A2 is 1 and B2 is 0, my formula returns 1
If A2 is 0 and B2 is 1, my formula returns 1
If A2 is 1 and B2 is 1, my formula returns 1
If A2 is 0 and B2 is 0, my formula returns 0
The formula will look like this in excel =IF(OR(AND(A2=1,B2=1),A2=1,B2=1),1,0)
But in Kobo it is not working.
if(or(and(${variable_name}=‘1’,${variable_name}=‘2’),${variable_name}=‘1’,${variable_name}=‘7’),1,0)
Please if you can help me.
Hi @hakan_cetinkaya
Thanks for your help, yes this works for either A or B but does not work when both A and B are selected because its multiple choice question.
I just built on your solution one step further - if this is in one question (as a multiple select) instead of two different questions, you can use this as a formula:
if (selected(${Q1},‘a’) or selected(${Q1},‘b’), 1, 0)
Let me know if that works!
Here’s a copy of the XLSForm to see it working: A or B.xlsx (10.3 KB)