# Check between automatictotal and manually filled total

**URL:** <https://forum.getodk.org/t/check-between-automatictotal-and-manually-filled-total/5923>\
**Category:** Support\
**Created:** [September 12, 2016, 5:06pm UTC](https://forum.getodk.org/t/check-between-automatictotal-and-manually-filled-total/5923 "2016-09-12T17:06:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dev](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dev/32/3449_2.png) [@Dev](https://forum.getodk.org/u/Dev)\
**Post date:** [September 12, 2016, 5:06pm UTC](https://forum.getodk.org/t/check-between-automatictotal-and-manually-filled-total/5923/1 "2016-09-12T17:06:28Z")

</div>

Hello everyone...

I am a new user of ODK. Actually, I want to check total children q1=1(daughter) and q2=2(Sons) the total variable is q3=3(Total). Please help me how to check between q1+q2=q3 if manually input data q3=5 wrongly. I have idea of to make total of q1+q2 but i couldn't check such problem.

Could you please help me to solve the problem.

Thank you,

Dev, Nepal

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [September 14, 2016, 3:20pm UTC](https://forum.getodk.org/t/check-between-automatictotal-and-manually-filled-total/5923/2 "2016-09-14T15:20:08Z")

</div>

Hi Dev from Nepal,

I find that phones do math better than people, so I don't let users  
enter the total! Just have the form calculate it and show it to them.  
I usually use a calculate question with "${q1} + ${q2}" as the  
calculation.

The trick here is that if your inputs are not required, a user might  
leave q1 or q2 blank and that will cause the calculation to fail. So  
either have all inputs be required or use something like  
"if(${q1}!='',${q1},0) + if(${q2}!='',${q2},0)" to set a default value  
of 0 when q1 or q2 is blank.

I've attached an example.

Yaw

[sum.xlsx](https://getodk.b-cdn.net/uploads/default/original/1X/33891a2ef745ab96a44b2f4a238e931447caf5c3.xlsx) (10.8 KB)

> **···**
>
> On Mon, Sep 12, 2016 at 5:06 PM, wrote: \> Hello everyone... \> \> I am a new user of ODK. Actually, I want to check total children q1=1(daughter) and q2=2(Sons) the total variable is q3=3(Total). Please help me how to check between q1+q2=q3 if manually input data q3=5 wrongly. I have idea of to make total of q1+q2 but i couldn't check such problem. \> \> Could you please help me to solve the problem. \> \> Thank you, \> \> Dev, Nepal \> \> -- \> -- \> Post: opendatakit@googlegroups.com \> Unsubscribe: opendatakit+unsubscribe@googlegroups.com \> Options: http://groups.google.com/group/opendatakit?hl=en \> \> --- \> You received this message because you are subscribed to the Google Groups "ODK Community" group. \> To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com. \> For more options, visit https://groups.google.com/d/optout.
