WORKDAY with Formulas, TIME Format & Work Hours

kpeacock

New Member
Joined
Oct 13, 2008
Messages
3
Can someone help with a workday question.
Analysis ToolPak is loaded & checked.

I have tried variations of the workday function without success.

My questions are:
Can you have a formula where Number of Workdays goes, if so how?
Can the format be TIME?
How do I address work hours?

Row 1
Col A = Start Date/Time = 9/5/08 4:00 PM Fri
Col B = End Date/Time = WORKDAY FORMULA GOES HERE
Col C = Duration = 1 hr 30 min

My cell format for Col A and B is mm/dd/yy h:mm AM/PM ddd
My cell format for Col C is h:mm.

Col B cannot be a Weekend or Holiday, and work hours 8 to 5
Expected Result is: 9/8/2008 8:30 AM Mon

This is an example of what I have that is not working.
(the holidays is working when just a NUMBER is entered where A1+C1 is in the formula)

IN ROW:1, COl:B =WORKDAY(A1,A1+C1,holidays)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Assuming that it will never go over two weekends

=A1+A3+(WEEKDAY(A1+A3)=7)+(WEEKDAY(A1+A3,2)>5)
 
Upvote 0
Hello kpeacock, welcome to MrExcel

Assuming you have daily start and finish times in E2 and F2, i.e. for your example

E2 = 08:00
F2 = 17:00

Then you can use this formula in C1

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

Assumption is that A1 is a date and time within working hours, then formula should work for any (positive) time in C1.
 
Last edited:
Upvote 0
Thank you xld..not sure where A3 came into the formula?

Thank you barry...just for clarification:
I have these to factors:

A1 is Start Date
C1 is how long the task will take

I am looking for the formula for B1...what will be my end date and time base on A1 and C1.

Your example has me putting the formula on top of my duration.
 
Upvote 0
Sorry,

Yes I understand what you want to do....the formula is correct (I think :)) but I said it should go in C1....I meant B1,.....obviously format B1 to show date and time as per A1
 
Upvote 0
barry - you are brilliant = it worked.
I don't know why I did not think of ceiling.

thank you thank you :)
 
Upvote 0
Barry,

Sorry to resurrect this topic ...

But how on earth, can it be possible to modify your formula to account for a one-hour lunch break ???

Cheers
 
Upvote 0
Hello mr Barry and others,

could someone please help me with task.
Formula below fits perfect only if start day is business day + start time is in work ours.
However, is it possible to adjust formula, that start day could be weekend or start time could be non work hours?


Hello kpeacock, welcome to MrExcel

Assuming you have daily start and finish times in E2 and F2, i.e. for your example

E2 = 08:00
F2 = 17:00

Then you can use this formula in C1

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

Assumption is that A1 is a date and time within working hours, then formula should work for any (positive) time in C1.
 
Upvote 0
Hi all,

I have solved this out by adding "help" column, which looks up if start date and time is in working hours period, if not, it gives next working day. So if task comes at work hours, formula below is used, if task comes after work hours, formula starts to calculate from next work day working hours.

Assuming you have daily start and finish times in E2 and F2, i.e. for your example

E2 = 08:00
F2 = 17:00

Then you can use this formula in C1

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


Anyway, I need another calculation of exact time, how long did it take to complete task, EXCLUDING non working hours and weekends. Still don't have idea how to do it. Could anyone help me please ?

Hello mr Barry and others,

could someone please help me with task.
Formula below fits perfect only if start day is business day + start time is in work ours.
However, is it possible to adjust formula, that start day could be weekend or start time could be non work hours?
 
Upvote 0
Hi guys,

any ideas?

I have start and end times of the task (DATE + TIME).
Work hours: 08:00 - 17:00
Goal is to calculate how long did it take to complete task (excluding weekends(holidays) and non working hours).

Could someone please help with calculation?


Hi all,

I have solved this out by adding "help" column, which looks up if start date and time is in working hours period, if not, it gives next working day. So if task comes at work hours, formula below is used, if task comes after work hours, formula starts to calculate from next work day working hours.

Assuming you have daily start and finish times in E2 and F2, i.e. for your example

E2 = 08:00
F2 = 17:00

Then you can use this formula in C1

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


Anyway, I need another calculation of exact time, how long did it take to complete task, EXCLUDING non working hours and weekends. Still don't have idea how to do it. Could anyone help me please ?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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