Adding time to a date excluding weekends and holidays

ToddG

Board Regular
Joined
Sep 28, 2004
Messages
82
I've been reading up on Excel's date and time functions and can't really figure out the best way of doing this. Any input would be appreciated.

I have a total amount of time that a machine should take to finish a task. I'd like to enter a date and time into a cell (Start Date) and have another cell return the date and time that the machine should be done with the task excluding weekends, and holidays (End Date). This would be based on a certain number of "working hours" (hours in the workday minus break periods) that would be calculated in another cell.

Has anyone done anything similar to this or could point me to some good info on it?

Thanks very much in advance
 
So you said that "I set working hours per day from 08h00 to 05h00" the latter will need to be 17:00 if the format is hh:mm
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
OK I know it doesn't help much but it certainly works for me!

I have 12-feb-10 16:00 in A1, 12:00 in B1 and D2 and E2 are 08:00 and 17:00

C1 has the formula and the result is 16-feb-10 10:00 as expected

What do you have in A1 and B1?
 
Upvote 0
OK I know it doesn't help much but it certainly works for me!

I have 12-feb-10 16:00 in A1, 12:00 in B1 and D2 and E2 are 08:00 and 17:00

C1 has the formula and the result is 16-feb-10 10:00 as expected

What do you have in A1 and B1?

can I not separate the date and time into two cells ?
 
Upvote 0
Yeah, you can do it that way if you want, in fact it's a shorter formula. The previous method was just the way I did it for somebody else who specified time and date in one cell.....

If you have start date in A1, start time in B1, hours in C1 and MF start and end times in D2 and E2 then the formula for out put of end date/time in one cell would be

=WORKDAY(A1,CEILING((C1+B1-E$2)/(F$2-E$2),1)-1)+B1+C1-CEILING(B1+C1-E$2,F$2-E$2)+F$2-E$2

or if you want the output in separate cells too then you can just split the formula in half, i.e. for date

=WORKDAY(A1,CEILING((C1+B1-E$2)/(F$2-E$2),1)-1)

and for time

=B1+C1-CEILING(B1+C1-E$2,F$2-E$2)+F$2-E$2

As before the start date and time should be within the working hours defined in D2:E2
 
Upvote 0
Sorry I pushed everything across to accommodate an extra cell for time, I gave you the wrong information on D2 and E2......

The start date is A1, start time is B1 and hours to add in C1, the formula should go in D1.....and E2 and F2 are the start and end times of the working day, so using the same as before E2 would be 08:00 and F2 17:00
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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