Adding Business Hours to a date

egagnon

New Member
Joined
Mar 18, 2005
Messages
9
Good Day... I'm having a problem figuring out how to add time to a date and exclude non-working hours/holidays/and weekends. If I use this formula "MOD(D26,1)-MOD(B26,1)+(NETWORKDAYS(B26,D26)-1)*3/8" for example if my inputs are 03/18/2005 2:00 PM and 03/21/2005 9:00 AM it returns a time of 4 hours, which is correct. My problem is that I need my inputs to be the first date and the number of hours and a formula that returns the later date. Any help would be appreciated....
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Welcome to the board!


If you only need the dates:

=WORKDAY(A1,ROUNDUP(B1/8,0))

A1 = start date
B1= hours


If you need date and time you need to specify your office hours.
 
Upvote 0
Yes, I do need date and time and office hours are 8:00 AM to 5:00 PM Monday through Friday. For example... I need it so if I enter 03/18/05 2:00 PM in A1 and 5 hours in A2 the formula in A3 will report 03/21/05 9:00 AM. Also, I know that I can input holidays using the NETWORKDAYS funcion. WIll this also work with WORKDAY function as well?
 
Upvote 0
Please explain what answer you want for the following example and how you would want it to be calculated.
Book1
ABCD
1StartHours
22005-03-18 10:00 AM10
3
Sheet4
 
Upvote 0
If I had those two inputs I would want the equation to out put 03/21/2005 11:00 AM. Is this possible?
 
Upvote 0
Try:

=IF(17-MOD(A2,1)*24>B2,A2+B2/24,WORKDAY(A2,MAX(1,INT((B2-(17-MOD(A2,1)*24))/8)))+"08:00"+MOD((B2-(17-MOD(A2,1)*24)),8)/24)


You might find some results odd due to the fact that we calculate 8 hours per day but the work time you specify (8 to 17) is 9 hours. You can adjust that if you want.

A holliday range can be added like this:


=IF(17-MOD(A2,1)*24>B2,A2+B2/24,WORKDAY(A2,MAX(1,INT((B2-(17-MOD(A2,1)*24))/8)),holidays)+"08:00"+MOD((B2-(17-MOD(A2,1)*24)),8)/24)
 
Upvote 0
I've run into a problem with this formula. when I put 03/21/05 at 2:30 pm as the received date and then 10 hours... it will give the correct output of 03/22/05 at 3:30 pm, but if I increase it to 11 hours instead of giving me the correct 03/22/05 at 4:30, it responds with 03/22/05 at 8:30 am. Do you know why this would be happening?
 
Upvote 0

Forum statistics

Threads
1,215,049
Messages
6,122,864
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top