# Slight error in my timesheet form -1

• 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

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?

• 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.  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.

• 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: These are the results: 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): 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: The final field will simply join these two together, so they are easier to read: 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: The final result will be: Let us know if this solution works for you.