# Calculation within a form

**URL:** <https://community.glideapps.com/t/calculation-within-a-form/36200>\
**Category:** Ask for Help\
**Created:** [December 21, 2021, 4:59pm UTC](https://community.glideapps.com/t/calculation-within-a-form/36200 "2021-12-21T16:59:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siglide1110](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/siglide1110/32/15991_2.png) [@Siglide1110](https://community.glideapps.com/u/Siglide1110)\
**Post date:** [December 21, 2021, 4:59pm UTC](https://community.glideapps.com/t/calculation-within-a-form/36200/1 "2021-12-21T16:59:05Z")

</div>

I’m looking to calculate the total of some number inputs on a form and then update a cell with the result. Any ideas welcome.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [December 21, 2021, 7:05pm UTC](https://community.glideapps.com/t/calculation-within-a-form/36200/2 "2021-12-21T19:05:54Z")

</div>

With a native glide form, you won’t be able to show the calculation in real time as they type, but once you submit the form, the destination sheet could have a math column to do the calculation.

I’d you want to see the calculations in real time, then I would set up a custom form.

> [@How do I create a custom form?](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014):
>
> I’m just dropping this here so I have something to refer people to when they ask. This is a simple concept app (copyable), that demonstrates the following techniques: Building custom forms for adding and editing list items (as an alternative to the native forms provided by Glide) Preventing duplicate new entries using [User Specific Columns](https://docs.glideapps.com/all/reference/data-editor/user-specific-columns) and [Relations](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column) Enforcing mandatory input items The use of visibility conditions and user specific booleans to control user flow There is nothing particula…

---

<div class="post-metadata">

**Author:** ![Siglide1110](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/siglide1110/32/15991_2.png) [@Siglide1110](https://community.glideapps.com/u/Siglide1110)\
**Post date:** [December 23, 2021, 11:20am UTC](https://community.glideapps.com/t/calculation-within-a-form/36200/3 "2021-12-23T11:20:18Z")

</div>

Thanks for coming back to me on this!

Math column after submission works great, what i need to to do now though is update a cell in the sheet (in this case total number of hours) with the result from the math column after the form has been submitted, is there a way to do this?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 23, 2021, 11:54am UTC](https://community.glideapps.com/t/calculation-within-a-form/36200/4 "2021-12-23T11:54:15Z")

</div>

Is it a complex one? I think you can use an arrayformula for that to ensure that it works, if you absolutely need that value in the Sheet.

---

<div class="post-metadata">

**Author:** ![w11](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/w11/32/36457_2.png) [@w11](https://community.glideapps.com/u/w11)\
**Post date:** [December 23, 2021, 12:06pm UTC](https://community.glideapps.com/t/calculation-within-a-form/36200/5 "2021-12-23T12:06:28Z")

</div>

I created a timesheet app with all of the math being performed on the sheet in google docs. It is only for Mon - Fri but that is all I need. It also adds in overtime. The totals show up on Friday’s tab. You could also create a totals sheet and thus create another tab. You will see each month is available on the menu (three bar to the left) screen. Here you can copy and edit as desired:

> **[2022 Timesheet for Distribution](https://goofy-talk-1483.glideapp.io/)**

---

<div class="post-metadata">

**Author:** ![Siglide1110](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/siglide1110/32/15991_2.png) [@Siglide1110](https://community.glideapps.com/u/Siglide1110)\
**Post date:** [December 23, 2021, 2:12pm UTC](https://community.glideapps.com/t/calculation-within-a-form/36200/6 "2021-12-23T14:12:12Z")

</div>

I think this is what i need, i just need to retain the formula contained within the cell. Can you retain sum formulas upon form submissions?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 23, 2021, 11:54pm UTC](https://community.glideapps.com/t/calculation-within-a-form/36200/7 "2021-12-23T23:54:04Z")

</div>

If you need it in the Sheets then you can read my tutorial in the link below. Let me know if you have any questions.

> [@Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts](https://community.glideapps.com/t/tutorial-arrayformula-in-google-sheets-good-practices-how-to-overcome-arrayformula-restrictions-with-scripts/9727):
>
> Hi, Today I will show you the script that can make copying formulas down work, when it does not work with arrayformula. But first, let’s have some introductions about arrayformula, for those who has not used this before in Google Sheets, some equivalents in Glide and some good practices while using it. I hope it can help you in building your Glide apps as well as applying it in your normal day job. 
> 
> > **1/ Definition**
> >
> > Arrayformula is defined as “a range, mathematical expression using one cell range …
