If one of the answer options is ‘none of the above’ and I want to count the number of options selected except if ‘none of the above’ is selected, how to solve that?
Maybe you could do it as outlined in the image shared below:
In the survey tab of your xlsform:
In the choices tab of your xlsform:
Data entry screen as seen in Enketo: (when none is not included)
Data entry screen as seen in Enketo: (when none is included)
Reference xlsform:
count-selected.xlsx (13.5 KB)
2 Likes
Thank you - very useful!
2 Likes
Hello,
May I add a form design hint?
Why not set a constraint that “None” can only be selected alone, i.e… cannot be combined with amother choice item?
1 Like
yes thanks, I do have that constraint, but still want to be able to count the number of options selected.
1 Like
So, you could just do the count in an if clause if( selected(…) = ‘’, '", if( selected(…) = ‘YourNoneName’, 0, count-selected(…) ) )
2 Likes