Calculate total hours in tables

  • Anisha
    Asked on November 2, 2021 at 9:13 AM
    Formula/s:

    On the link you'll see 2 tabs (Weekly Timesheet & Employee Directory) - I am currently referring to the Weekly Timesheet tab.

    So, I need assistance in the Total Hours column:

    1635855158 61812b36d1034  Screenshot 10

    This column will calculate the total hours worked Monday to Sunday (we usually only work Monday to Friday, but we sometimes work on weekends when things need to get done). Currently this column only counts the hours and not the hours and minutes.

    Also, how can I make the form to be able to take more than one draft? I have seen this is also an issue, because my co-worker was busy with her form and I tried to fill in a form as well, but it wanted me to either submit or discard the current draft.
  • Sonnyfer JotForm Support
    Replied on November 2, 2021 at 9:20 AM

    Kindly allow me some time to check your tables. I will be back shortly.

  • Sonnyfer JotForm Support
    Replied on November 2, 2021 at 9:46 AM

    Thanks for patiently waiting. Looks like the table can't calculate the hours + minutes through the formula. I suggest calculating the total in the form itself. Take a look at this form:

    1635860688 618140d08045f adzx213 Screenshot 10

    Would it work for you? I got the total by adding the time fields in the widget.

    1635860748 6181410c26176  Screenshot 21


  • Kevin Support Team Lead
    Replied on November 5, 2021 at 4:49 PM
    1. You can enable the Time Range option on the Time field, here is where to find it:

      1636144737 6185966136b04  Screenshot 10
    2. If you use the time range option the calculation will already count the hours between the time range, here is a clear example:

      1636145107 618597d31bd4c 1 Screenshot 21
      As you can see the first time field will return the number of hours between both hours. So in other words you will need to modify your form and instead of using two time fields you should use only one.

    I would recommend to kindly modify your form according to the example and give it a try, let us know if you have any questions.

  • Ahmed_S
    Replied on November 7, 2021 at 5:48 AM

    Greetings,

    I've checked your form and found no issues with the calculations and it's set properly, in fact I recalculated your inputs as in the screenshot and found the total is 39h 27m which is 39.45 when converted to decimal number.

    1636281492 6187ac9460350 7 Screenshot 10Please let us know if you need further assistance we are happy to help.

  • waypointortho
    Replied on November 15, 2021 at 7:05 AM

    I've been following this thread, however, the Time Element you've suggested seems different than what is available for me. In your example, the user inputs the time like a text box, however when I add this element to the form, the only option for the time is a Drop-down for Hour/Min.

    Am I using the wrong Element?

  • Sonnyfer JotForm Support
    Replied on November 15, 2021 at 8:13 AM

    I checked your form and it seems you haven't enabled TIME yet on your date picker field. Please turn it ON so you input time in a textbox

    1636981927 61925ca74344c  Screenshot 10In case I misunderstood your query, kindly share some screenshots for us to see what it looks like from your end.

    Guide: How-to-Post-Screenshots-to-Our-Support-Forum

  • waypointortho
    Replied on November 15, 2021 at 1:38 PM

    Thank you. There was a misunderstanding. The screen shots from the thread above indicate the Time Element is being used, and not the Date Picker Element. However, when I use the Time Element, the only options I see available is the Drop-Down

    1637001530 6192a93a7133d SS1 Screenshot 10

  • Martin_A
    Replied on November 15, 2021 at 3:29 PM

    Hi there,

    Sorry for the misunderstanding about the element being used.
    You can remove and add the Time Element in your form and see if that will resolve the issue with the drop-down options to select the time. We have cleared your form's caches in case that is causing some issues with the form. If you have still issues with the Time Element and its properties provide us with more details and information so we can further assist you.

    Thank you.