Matching the numbers being summed within a matrix table

Hi,
I want to match the answer of 1st question with matrix response:

Example: Family size =15
Now in Matrix
Age Group Male Female
0-4 3 2
5-11 4 2
12-17 1 1
18-35 1 1

Now the response of the matrix should be equal to 15 the previous answer how I can do that.
Thanks

0-4 is age group and 3 represent Male and 2 represents Female

Hi @mazhar,

Welcome to the community! Would you mind having a look at the post that has been discussed previously (it should solve your issue):

Have a great day!

1 Like

Hi @Kal_Lam, What I am looking for is to use calculate function in Matrix

1 Like

Hi @mazhar,
For what you are looking for, I would recommend you look at the discussions below

Stephane

I want to restrict the matrix value with family size.

1 Like

Hi
Have you tried creating this using the instructions that I had sent earlier? Please do and then send the XLS form that you have created if you have a problem. It is much easier helping you when you have attempted to do it first.

Stephane

1 Like

Whn I do this I can’t preview my form it gives error. How I can share my XLS with you?

Hi
Send me the error message you are seeing and the XLS form you have created.

@stephanealoo Sorry system is not allowing me to upload file as new user. :frowning:

Hi @mazha,
Can you try uploading now?
Stephane

Hi @mazhar,

So if this is what you require, you could do it as outlined in the image below:

In the survey tab of your xlsform:

In the settings tab of your xlsform:

Image 2

Data entry screen as seen in Enketo: (Wrong Entry)

Data entry screen as seen in Enketo: (Correct Entry)

Reference xlsform:

Calculation in a Matrix Question.xlsx (11.5 KB)

Have a great day!

Hi @Kal_Lam ! Many thanks for the swift response and giving this solution I really liked that. a small problem here is it doesn’t accepts the value greater than family size which is good but it accepts the value less then family size.
Example:
Family Size =30 All M/F in matrix are entered as 14 and validated the form it accepted the value in this case it should not accept the value less then the family size.

Hi @mazhar,

If this is your requirement, you could do the same as outlined below:

In the survey tab of your xlsform:

In the settings tab of your xlsform:

Image 2

Data entry screen as seen in Enketo (with a wrong entry)

Reference xlsform:

Calculation in a Matrix Question.xlsx (11.8 KB)

Have a great day!

1 Like