# Kobotoolbox autocalculate

**URL:** <https://forum.getodk.org/t/kobotoolbox-autocalculate/13771>\
**Category:** Support\
**Created:** [June 28, 2018, 6:04am UTC](https://forum.getodk.org/t/kobotoolbox-autocalculate/13771 "2018-06-28T06:04:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saniyas](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/s/e68b1a/32.png) [@saniyas](https://forum.getodk.org/u/saniyas)\
**Post date:** [June 28, 2018, 6:04am UTC](https://forum.getodk.org/t/kobotoolbox-autocalculate/13771/1 "2018-06-28T06:04:09Z")

</div>

Hi guys, I'm trying to use the calculate function to autocalculate total score based on previous questions that are likert scale e.g. Is your sleep disturbed? Options: Never=0, Sometimes=1,Often=2, Always=3.There are 25 such questions and based on the answers a total score is calculated.I was able to do this for another questionnaire which only had Yes/No response but having trouble with the four point calculation code. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![Xiphware](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/xiphware/32/2587_2.png) [@Xiphware](https://forum.getodk.org/u/Xiphware)\
**Post date:** [June 28, 2018, 7:05am UTC](https://forum.getodk.org/t/kobotoolbox-autocalculate/13771/2 "2018-06-28T07:05:05Z")

</div>

do you get a valid result when you have answered _all_ 25 questions?

---

<div class="post-metadata">

**Author:** ![saniyas](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/s/e68b1a/32.png) [@saniyas](https://forum.getodk.org/u/saniyas)\
**Post date:** [June 28, 2018, 7:15am UTC](https://forum.getodk.org/t/kobotoolbox-autocalculate/13771/3 "2018-06-28T07:15:25Z")

</div>

Yes, all 25 are marked mandatory.

---

<div class="post-metadata">

**Author:** ![Xiphware](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/xiphware/32/2587_2.png) [@Xiphware](https://forum.getodk.org/u/Xiphware)\
**Post date:** [June 28, 2018, 7:20am UTC](https://forum.getodk.org/t/kobotoolbox-autocalculate/13771/4 "2018-06-28T07:20:32Z")

</div>

Um, do you mean "Yes" you do get the expected (valid) result when all 25 are answered, but if fewer than 25 are answered then the result is somehow 'bad'?

Perhaps post what your calculation looks like.
