Exclude "99" or "98" from calculation while adding

Hello,

I am trying to compute a total score by add numbers from various questions. However, for each of these question, the instruction is to input “99” for don’t know/Not sure.

For example
q1. How many bags of rice did you produce in 2021?
q2. How many bags of rice did you produce in 2010?

the calculation would q1+q2
Now if someone should input 99 in either q1 or q2, it should not be added more like treated as zero.

Can someone please help me or refer me to a similar problem if previously asked?

Thanks

Welcome back to the community, @RayRay! Maybe you could do the same as outlined in the image shared below:

In the survey tab of your xlsform:

Data entry screen as seen in Enketo: when 98 is entered in one of the question

Data entry screen as seen in Enketo: when 99 is entered in one of the question

Data entry screen as seen in Enketo: when neither 98 nor 99 is entered in any of the question

Reference xlsform:

Sum (Excluding Code 98 & 99).xlsx (9.9 KB)

@Kal_Lam Thanks for the support. It works perfectly.

1 Like