Slight error in my timesheet form -1

  • Profile Image
    princess5510
    Asked on March 13, 2021 at 03:55 AM

    Here is a link to my timesheet form that i was asked to create for my college.

    https://www.jotform.com/build/210670770585459

    Please clone it.

    According to the form when students enter their clock in and clock out.

    The time should be calculated below in the total hours column.

    I have done the epoch calculations and i have done all the steps for the time calculation procedures.

    However there still seems to be error.

    When i enter clock in clock out and fill all session details for the first row it doesnt calculate for day 1?

    It expects to fill the entire table for it to calculate each day's time calculation.

    Can anybody help?

    Please

  • Profile Image
    Basil_A
    Answered on March 13, 2021 at 03:07 PM

    Hi,

    I have cloned the form and the calculation works as long as you enter the date for the day you are filling.

    1615665934_604d1b0e613d3_chrome_GeP9CPdy

    1615665954_604d1b229392d_chrome_HymCE8tn

    Although, It seems there is an issue with the calculations equation.

    Could you explain how the equation is supposed to work?

    Please let us know if you require any further assistance.

  • Profile Image
    Bojan_J
    Answered on March 15, 2021 at 08:04 AM

    Greetings.

    Have you updated your form? I have tested few fields, and the calculations are correct:

    screenshot_4246.png

    These are the results:

    screenshot_4247.png

    Currently, you have conditions enabled only for these 3 fields. The results are showing as fractions (for the second day, 1.25*60 is 75 minutes, which is 1:15 when converted to hours).

    If you need to get hours and minutes, you will need to add additional 3 calculation fields. The first two will be used to calculate hours and minutes, and the final one will combine those two.

    To calculate the hours, you need to use the floor function on the Day 1 field (please note that I have renamed Day 1 Hours to Day 1 Total):

    screenshot_4248.png

    To calculate the minutes, you first need to multiply the total by 60, to get the selected time in minutes. Then, you need to subscript that from the result of the multiplication of total hours and 60. This will only give the selected number of hours. The difference in the selected minutes:

    screenshot_4249.png

    The final field will simply join these two together, so they are easier to read:

    screenshot_4250.png

    I have added these on the cloned form, you can test it here:
    https://form.jotform.com/210733092392957

    You will need to do this for every field you have, I have only done it for day one. You can also hide helper fields by right-clicking on them, however, I didn't so you can see the results.

    So, if someone enters this:

    screenshot_4251.png

    The final result will be:

    screenshot_4252.png

    Let us know if this solution works for you.