# Adding the numbers

**URL:** <https://forum.getodk.org/t/adding-the-numbers/11983>\
**Category:** Support\
**Tags:** odk-xlsform\
**Created:** [February 26, 2018, 9:39am UTC](https://forum.getodk.org/t/adding-the-numbers/11983 "2018-02-26T09:39:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanish\_shrestha](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/sanish_shrestha/32/3282_2.png) [@sanish\_shrestha](https://forum.getodk.org/u/sanish_shrestha)\
**Post date:** [February 26, 2018, 9:39am UTC](https://forum.getodk.org/t/adding-the-numbers/11983/1 "2018-02-26T09:39:59Z")

</div>

**What is the problem? Please be detailed.**

Q1. Does any of your son and daughter live with you?  
option:  
Yes..1  
No...2--------\> Q3

Q2a. How many son live with you?

Integer |\_\_\_\_\_\_\_\_\_|

Q2b. How many daughter live with you?

Integer |\_\_\_\_\_\_\_\_\_|

Q3. Does any of your son and daughter that you gave birth doesn't live with you?  
option:  
Yes..1  
No...2--------\>Q5

Q4a. How many son doesn't live with you?

Integer |\_\_\_\_\_\_\_\_\_|

Q4b. How many daughter doesn't live with you?

Integer |\_\_\_\_\_\_\_\_\_|

Q5. Does any of your son and daughter that they were born alive but later they were dead?  
option:  
Yes..1  
No...2 -------\>Q7

Q6a. How many son doesn't live with you?

Integer |\_\_\_\_\_\_\_\_\_|

Q6b. How many daughter doesn't live with you?

Integer |\_\_\_\_\_\_\_\_\_|

Q7. Add answer from 2a, 2b, 4a, 4b, 6a, 6b and display it

**What ODK tool and version are you using? And on what device and operating system version?**

**What steps can we take to reproduce the problem?**

**What you have you tried to fix the problem?**

**Anything else we should know or have? If you have a test form or screenshots or logs, attach here.**

---

<div class="post-metadata">

**Author:** ![Grzesiek2010](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/grzesiek2010/32/2881_2.png) [@Grzesiek2010](https://forum.getodk.org/u/Grzesiek2010)\
**Post date:** [February 26, 2018, 10:57am UTC](https://forum.getodk.org/t/adding-the-numbers/11983/2 "2018-02-26T10:57:18Z")

</div>

Hi @sanish_shrestha

I think you use something like that:  
[test.xml](https://getodk.b-cdn.net/uploads/default/original/2X/f/f738a8977dcdb5a874284aad8094da71e50ce847.xml) (3.2 KB)  
[test.xlsx](https://getodk.b-cdn.net/uploads/default/original/2X/3/321e03ab960585ffb5abc78553c2e555c211e638.xlsx) (6.8 KB)

More info about building forms you can find here: [http://xlsform.org/](http://xlsform.org/)

Regards,  
Grzegorz

---

<div class="post-metadata">

**Author:** ![SGSC](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/sgsc/32/3918_2.png) [@SGSC](https://forum.getodk.org/u/SGSC)\
**Post date:** [February 26, 2018, 1:15pm UTC](https://forum.getodk.org/t/adding-the-numbers/11983/3 "2018-02-26T13:15:52Z")

</div>

Hello @Grzesiek2010,

Yes that will be a solution given that he has selected all the options . But , if anyone is not selected it would show it as NaN . So before displaying it we have to either put that value as 0 or we should not display that value. To do either of them we have to add a calculate field or relevant condition respectively based upon the user requirement .

---

<div class="post-metadata">

**Author:** ![sanish\_shrestha](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/sanish_shrestha/32/3282_2.png) [@sanish\_shrestha](https://forum.getodk.org/u/sanish_shrestha)\
**Post date:** [February 27, 2018, 4:01am UTC](https://forum.getodk.org/t/adding-the-numbers/11983/4 "2018-02-27T04:01:00Z")

</div>

@Grzesiek2010 But I wanna sum all those answer and display it, but when the question is skipped then the sum of total number is not displayed and when I enter all the answer of the question then only the sum of those answer is displayed.

${q2a} + ${2b} + ${4a} + ${4b} + ${6a} + ${6b} I did this in calculation but it doesn't work when the question is skipped

---

<div class="post-metadata">

**Author:** ![Grzesiek2010](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/grzesiek2010/32/2881_2.png) [@Grzesiek2010](https://forum.getodk.org/u/Grzesiek2010)\
**Post date:** [February 27, 2018, 12:27pm UTC](https://forum.getodk.org/t/adding-the-numbers/11983/5 "2018-02-27T12:27:16Z")

</div>

@sanish_shrestha

check out this: [test.xlsx](https://getodk.b-cdn.net/uploads/default/original/2X/5/577ae5b09ba8c964f8a275975f6f9c9deba02732.xlsx) (7.0 KB)

---

<div class="post-metadata">

**Author:** ![sanish\_shrestha](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/sanish_shrestha/32/3282_2.png) [@sanish\_shrestha](https://forum.getodk.org/u/sanish_shrestha)\
**Post date:** [February 27, 2018, 1:19pm UTC](https://forum.getodk.org/t/adding-the-numbers/11983/6 "2018-02-27T13:19:26Z")

</div>

@Grzesiek2010 Thank you. It helped me
