Form Question - Count Selected

Hello All,

Seeking some help! I am trying to code the following conditions into XLS form for application in Kobo.

  • Only consider response options 1 through 6 when selecting from the following three options (option 7 is only taken into account if it is the only option selected):
  • IF ‘6’ is not selected, then score is ‘1’
  • IF ‘6’ is selected AND any other option is selected, then score is ‘3’
  • IF ‘6’ is the only option selected, then score is ‘5’
  • IF ‘7’ is the only option selected, the score is ‘3’

For the first three conditions, I have developed the following, which is working. I’ve also attached the XLS for reference.

if( count-selected(${d8_fin_resources}) >= “1” and not(selected(${d8_fin_resources}, ‘6’)), 1, if( count-selected(${d8_fin_resources}) >= “1” and (selected(${d8_fin_resources}, ‘1’)), 3, if( count-selected(${d8_fin_resources}) = “1” and selected(${d8_fin_resources}, ‘6’), 5, 3)))

I’m having difficulty, however, adding the final bullet-point or condition, which again is:

  • IF ‘7’ is the only option selected, the score is ‘3’

Can anyone help me with guidance on how to modify the scoring code mentioned above so that that last condition (IF ‘7’ is the only option selected, the score is ‘3’) can be properly included in the score calculation?

Again, the XLS attached properly captures all conditions but that last one, and when I try to add it it breaks the scoring code. Would so greatly appreciate any help you can offer on this. I’m also putting a form link here with the calculations as they stand demonstrating that all of the conditions besides the last one referenced above are functioning as should be the case.

Thank you in advance for your support.

Domain 8 - Scoring Rubric (Example).xlsx (21.5 KB)

Welcome back to the community, @nmuser! Did you mean …

  • If 6 is not selected but anything other then 7 is selected, the response gets a score of 1
  • If 6 is selected along with any other option other then 7 is selected, the response gets a score of 3
  • If 6 is only selected, the response gets a score of 5
  • If 7 is only selected, the response gets a score of 3

Feel free to correct me if I understood your requirement differently?

Hello, try this formula:

if(count-selected(${d8_fin_resources}) = 1 and selected(${d8_fin_resources}, ‘7’), 3, if(count-selected(${d8_fin_resources}) = 1 and selected(${d8_fin_resources}, ‘6’), 5, if(selected(${d8_fin_resources}, ‘6’) and count-selected(${d8_fin_resources}) > 1, 3, if(not(selected(${d8_fin_resources}, ‘6’)) and count-selected(${d8_fin_resources}) >= 1,1,‘’))))

This logic ensures:

  • If only option 7 is selected → score = 3

  • If only option 6 is selected → score = 5

  • If option 6 and any other option are selected → score = 3

  • If any option except 6 is selected → score = 1

  • If nothing is selected → blank

Also, please correct the choices sheet for option 7. The original value in your file was:
government_support__any_govern
Make sure it matches the intended value for option 7.