How do I calculate hours requested in a time off request form?

  • NASHIA30
    Asked on March 9, 2025 at 2:01 PM

    I want to create a time off request form and calculate hours requested off. I would like to factor in weekends, an 8 hour workday, and partial day requests.


  • Gian_D JotForm Support
    Replied on March 9, 2025 at 4:35 PM

    Hi NASHIA30,

    Thanks for reaching out to Jotform Support. Can you explain a bit more about your goal so we can look for a way to achieve it?

    Once we hear back from you, we'll be able to help you with this.

  • NASHIA30
    Replied on March 9, 2025 at 5:08 PM

    I have created a workflow to approve time off request. I would like to have a way to track the hours per year each employee requests off work.

    I would like to collect the hours requested off in a google worksheet.
  • Reymae JotForm Support
    Replied on March 9, 2025 at 5:55 PM

    Hi NASHIA30,

    You can calculate the total hours of time request off on the Form Calculation Widget in your form. Let me show you how:

    1. In Form Builder, click the Form Calculation Widget, and then click the Wand icon on the right side.

    How do I calculate hours requested in a time off request form? Image 1 Screenshot 50

    2. Enter the following values:

    How do I calculate hours requested in a time off request form? Image 2 Screenshot 61

    3. Click the Save button.

    How do I calculate hours requested in a time off request form? Image 3 Screenshot 72

    Check out the screencast below to see my result:

    How do I calculate hours requested in a time off request form? Image 4 Screenshot 83

    You might also want to check out this guide about How to Perform Calculations Using a Widget. Just to avoid confusion, I've moved your other question to a new thread and helped you there. You can check it out here.

    Give it a try and let us know if you have any other questions.

  • NASHIA30
    Replied on March 10, 2025 at 8:55 AM

    Thank you for that. However, we operate on of an 8 hour workday. How do I get it to account for 8 hours per day and not 24 hours per day? For example: If someone uses the widget to take off two days, I need it to calculate 16 hours and not 48 hours.

  • Roi JotForm Support
    Replied on March 10, 2025 at 9:45 AM

    Hi NASHIA30,

    Thanks for reaching out to JotForm Support. I understand the issue, but I'll need time to move forward with the solution. I'll be replying to you shortly. 

    Thanks for your patience and understanding

  • NASHIA30
    Replied on March 10, 2025 at 3:31 PM

    Thank you!

  • Roi JotForm Support
    Replied on March 11, 2025 at 5:54 AM

    Hi NASHIA30,

    You just need to change the formula instead of calculating 24 hours to 8 hours. It's really easy. Let me show you how:

    1. In Form Builder, click the Form Calculation Widget, and then click the Wand icon on the right side.How do I calculate hours requested in a time off request form? Image 1 Screenshot 40

    2.Enter the following values as you see on the picture below and click on Save.

    How do I calculate hours requested in a time off request form? Image 2 Screenshot 51

    Check out the screencast below to see my result: How do I calculate hours requested in a time off request form? Image 3 Screenshot 62 You might also want to check out this guide about How to Perform Calculations Using a Widget.

    Give it a try and let usknow if you have any other questions.

  • NASHIA30
    Replied on March 11, 2025 at 8:44 AM

    Thank you for your reply. I did as instructed. I found that it works if someone takes off from one date at 8:00AM to the next day at 8:00AM (for example), but if I change the return time to 10:00AM, the calculation is off. Please advise.


  • Reymae JotForm Support
    Replied on March 11, 2025 at 9:41 AM

    Hi NASHIA30,

    Can you share your working hours with us? This will allow us to adjust the formula to calculate the duration of your time off accurately within those hours. Specifically, we need to determine how much of the requested time off falls within working hours to ensure precise tracking. If that’s not exactly what you’re looking for, can you explain a bit more so I can help you better?

    After we hear back from you, we’ll have a better idea of what’s going on and how to help.

  • NASHIA30
    Replied on March 11, 2025 at 9:47 AM

    Sure! We work an 8 hour day from 8 - 4 each day. We do not work on weekends and some US holidays.

  • Reymae JotForm Support
    Replied on March 11, 2025 at 10:41 AM

    Hi NASHIA30,

    It's really easy to calculate the exact duration of the leave with Time fields and Day Difference widget instead of a Date field. Let me walk you through it:

    1. In Form Builder, click on the Add Element menu on the left side of the page.
    2. Under the Basic tab, scroll down the list and choose the Time field.
    3. Now, just drag and drop it to your form.

    How do I calculate hours requested in a time off request form? Image 1 Screenshot 60

    You need to add four Time fields to your form for your Time of Beginning of Leave, Time Returning to Work, Working Hours Start, and Working Hours End. Next is to set the Value for the Working Hours Time Field. Let's do it:

    1. In Form Builder, select your Time field and click the Gear icon.
    2. Go to Options tab and set the Default Time to Custom and insert your working hours.

    How do I calculate hours requested in a time off request form? Image 2 Screenshot 71

    Then you can use a widget to calculate the Date difference:

    1. While in Form Builder, click on the Add Element menu on the left side of the page.
    2. Under the Widgets tab, scroll down the list and choose the Day Difference widget and drop it to your form.
    3. Click the Wand icon to set up the widget.
    4. Exclude the Weekends and enable the Calculate Difference feature.

    How do I calculate hours requested in a time off request form? Image 3 Screenshot 82 Finally, you can update your Total Hours Requested Off Formula like this:

    How do I calculate hours requested in a time off request form? Image 4 Screenshot 93

    You can clone and test my demo form here. Take a look at the screenshot below to see how it works:How do I calculate hours requested in a time off request form? Image 5 Screenshot 104

    Give it a try and reach out again if you have any other questions.