Long subject I know let me try this again.
Let me set the area for you. Do you like a challenge?
I am creating a sheet for work. To meet certain KPI if we receive urgent works we must have them completed in 6 business hours. I wish to create a sheet that can keep track of these work orders. In this sheet I wish to be able to enter the date a work order was received and the time. From here I want excel to calculate the date and time the work order is due and display a message stating due or not due by referring to a clock and date that is in built into excel.
All seems fairly straight forward.
In A1 I have created a clock that syncs with the systems time using VB, in another cell I created the date by using =today() these two cells are my reference point, they are A1 & c1 ( i have left a gap just for look sake)
I have created the following headings:
A3 - G3 are headings that are not important for my question
from H3 to L3 the headings are:
h3: Date Received
i3: Time received
j3: Date Due
k3: Time Due
L3: Work order Due
h3 - to be inputed by the user.
i3 - to be inputed by the user.
j3 - the date the work order is due ( calculated automatically )
k3 - the time the work order is due ( calculated automatically )
L3 - a simple if statement to display "due" or "not due"
The way I would like this to work is this, the user inputs data into H3 and I3, excel reads this date and time and adds 6 hours to the time and displays it under time due. for example works entered on the 25/3/10 at 8am, excel then would display date due as 25/3/10 at 2pm. That is simple to do. But my problem is this.
Now business hours are important here, so lets pretend business hours are from 8am to 5pm.
If we receive a work order on 25/3/10 at 4pm, I want excel to count forward 6 business hours. that would be 1 business hour on the 25/3/10 and than 5 business hours on the 26/3/10, starting at the start of business hours therefore displaying the date due as 26/3/10 and time due as 1pm.
That is the line of code I cant figure out. How do i tell excel to do this?
date received = 25/3
time = 4pm
therefore date due = date received + 1 ( as the 6 business hours will take it into tomorrow)
time due =8 + ( 6 - (the amount of hours that were left in business day 1)
I also need to make sure that if its Friday at 4pm than it starts counting from 8am Monday morning.Further I will need the ability to factor in public holidays at a later stage.
I have the following code:
A1 = VB code for the clock to auto update it self by the second.
C1 =today()
L4 =IF(C1>=J4,IF(A1>=K4,"due", "not due "),"not due")
I am not an expert with excel so any help you can give would be great. Like I said its pretty
I hope all of this made sense, If you like I can post the sheet.
Bookmarks