How to perform calculations based on the Spreadshseet widget cells?

  • jabedoya60
    Asked on July 26, 2017 at 8:35 PM
    Hi, any suggestions will be much appreciated, just want the parents to select the classes they want and a total added at the bottom right field, that is all. thank you.
  • Kevin Support Team Lead
    Replied on July 26, 2017 at 8:52 PM

    Unfortunately, it's not possible to perform calculations based on cells selection; however, it is possible to perform calculations based on the information entered on each cell in the widget. 

    If you would like to perform calculations based on field's selections, then you may try using the Input Table, it can be found under the quick elements section: 

    How to perform calculations based on the Spreadshseet widget cells?  Image 1 Screenshot 20

    This guide will help you performing calculations based on the Input Table field: https://www.jotform.com/help/414-Calculate-Values-in-the-Input-Table-Through-Condition 

    I hope this helps. 

  • jabedoya60
    Replied on July 26, 2017 at 10:54 PM

    You have to be kidding me, look at the very beginning of this post, I asked for help by showing an image of the table I needed to create, I followed all the suggestions, edits, corrections, I have asked the question about adding the classes over and over again and now you are telling me that I have to start from scratch with a different table??

     

    Look again at the image which I posted from the beginning last week:

     

    How to perform calculations based on the Spreadshseet widget cells?  Image 1 Screenshot 20

  • Nik_C
    Replied on July 27, 2017 at 5:03 AM

    We apologize, but in your original post, you were asking CSS related questions regarding how your table looks like, font sizes, font alignment etc.

    Spreadsheet widget is used when you want to enter certain data in it, but its cells can not be used to do calculations outside of it.

    You could calculate the total in Total row by using the formula:

    How to perform calculations based on the Spreadshseet widget cells?  Image 1 Screenshot 50

    But that will require that your numbers are without the dollar sign.

    I must agree with my colleague, Input table is the field you need in order to use its cells in form calculations.

    But the issue here is that you can not set default values in the table unless you use pre populate URL.

    But I did some work and created this:

    How to perform calculations based on the Spreadshseet widget cells?  Image 2 Screenshot 61

    I added one Input table and by using CSS I brought it up and made it as a fifth column, those check boxes you can use in calculations.

    I added the below CSS to make it work:

    th.form-matrix-row-headers {

        position: relative;

        left: 109px;

        width: 80px;

        border: none;

        z-index: 99;

    }

     

    td.form-matrix-values {

            text-align: left!important;

    }

     

    div#cid_55 {

        position: relative;

        left: 474px!important;

        top: -490px!important;

    }

    th.form-matrix-column-headers {

        background-color: white;

    }

    th.form-matrix-row-headers {

        background-color: white;

    }

    td.form-matrix-values {

        background-color: white;

    }

    Also, I added one form calculations field to calculate the total:

    How to perform calculations based on the Spreadshseet widget cells?  Image 3 Screenshot 72

    Finally, this is how it works:

    How to perform calculations based on the Spreadshseet widget cells?  Image 4 Screenshot 83

    Feel free to check my form: https://form.jotformpro.com/72071671385963

    Let us know if you have any further questions.

    Thank you!

  • jabedoya60
    Replied on July 27, 2017 at 10:03 PM

    Hi, that is perfect, thank you so much, how can i copy or clone the table to my form? Also, when I check out your form it looks a bit different when I select a few classes, look at the screenshot below, I get a yellow block of space under the table, and the toital field goes off to the right of the table, other than that it is perfect. Thank you again, is awesome!

    How to perform calculations based on the Spreadshseet widget cells?  Image 1 Screenshot 20

  • Kiran Support Team Lead
    Replied on July 28, 2017 at 1:10 AM

    You may clone the form to your account by following the guide below:

    https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL 

    In order to fix the table alignment on the top, please try changing the top margin to -510px from -490px in the injected CSS code.  

    How to perform calculations based on the Spreadshseet widget cells?  Image 1 Screenshot 20

    Please get back to us if you need any further assistance. We will be happy to help.