excelworkday-api

Excel add hours to date excluding weekends and holidays


I would like to add hours on a start date and skip weekends and holidays in an Excel file.

The hours would be 24, 36 and 48.

So if the start date and time are 4 Mar 2019, 13:42, the end date and time should be :

I am now using this formula:

=WORKDAY(E2,G2/24,Holidays!$A$2:$A$18)+MOD(E2,1)

E2 is the start date and time in mm/dd/yy hh:mm format, G2 is the number of hours, Holidays!$A$2:$A$18 is the range of holiday.

This formula works totally fine for 24 hours and 48 hours, however, it is not working for 36 hours. It would be much appreciated if someone would help me to solve this problem.


Solution

  • Construct a simple date from addition and then convert it to the workday.

    =WORKDAY(A2+B2/24-1, 1, Holidays!$A$2:$A$18)+MOD(A2+B2/24, 1)
    

    enter image description here