Limit number of choices AND prevent 2 other options from being chosen

Hello all. I need to create a multiple-choice question that has 8 options, with option #7 and #8 restricted to be the only option allowed if chosen AND to limit the number of selections to 3 choices while preventing choosing 7 and/or 8.
What I have until now is:
(not(selected(., “8”) and count-selected(.) >1)) and (not(selected(., “7”) and count-selected(.) >1))

Many thanks in advance.

1 Like

Welcome to the community, @M.Ayied! Sorry, I could not understand your issue. Could you kindly explain it with a dummy question, some choices, and the conditions you would like to set? Maybe that would help the community understand your requirement.

@Kal_Lam Please allow me to upload.

The issue is “select_multiple d.6”. I need to limit the options chosen to be at maximum three, and I also want to prevent choosing the below options:
-Others (Please specify)
-I don’t know
Since if they “dont know” or they prefer to write their response, they shouldnt pick any other option.
Hope that helps understanding my request, with many thanks.

Hello M. Ayied,

I have made a dummy version of your issues please get attached to the excel version.
MC_Constraint.xlsx (9.7 KB)

Hope this works for you.

Regards,
Dinesh Dongol

1 Like

Worked like a charm! Thanks Dnes and Kal_lam for your support. I shouldve thought about ifstatement.

@M.Ayied, you could do it as outlined below:

In the survey tab of your XLSForm:

In the choices tab of your XLSForm:

image

Data entry screen as seen in Enketo: when any 3 options other then other and don’t know are selected

Data entry screen as seen in Enketo: when any 3 options with other are selected

Data entry screen as seen in Enketo: when any 3 options with don’t know are selected

Data entry screen as seen in Enketo: don’t know only selected

Data entry screen as seen in Enketo: other know only selected

Reference XLSForm:

Constraint.xlsx (12.7 KB)

1 Like

Thanks Kal_Lam for your answer, its also a short version! Many Thanks.