Updating start times

Leonidas75

Board Regular
Joined
May 12, 2015
Messages
52
I am trying to create a formula where hours of business are from Monday 8am through to Friday 11PM uninterrupted. If i receive a ticket inside these hours my target response time is time received + 24 hours

What i am trying to calculate is if i receive a ticket outside of hours (say Friday 11.30pm). the ticket start time should begin on Monday 8am with response target Tuesday 8am (Public Holidays should be included).

If i receive a ticket on Friday 10PM then i have until Monday 10PM to respond (or Tuesday 10PM if monday PH).

so i need to show 2 columns - start time and target time.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
REVISED: THIS HAS AN ERROR THAT I NEED TO WORKOUT

I set up the worksheet below and faked that this coming Monday is a holiday to illustrate taking holidays into account.

Book5
ABCDE
18:00 AMHolidays
211:00 PM1/1/2021
37/4/2021
48/16/2021
5Ticket Rec'd TimeStart TimeTarget Time
68/13/2021 23:598/13/2021 8:008/17/2021 8:00
7
Sheet1
Cell Formulas
RangeFormula
B6B6=IF(WORKDAY(INT(A6)-1,1,Holidays)<>INT(A6),WORKDAY(INT(A6)-1,1,Holidays),INT(A6))+IF(AND(BusStartTime<=(A6-INT(A6)),(A6-INT(A6))<=BusEndTime),(A6-INT(A6)),BusStartTime)
C6C6=WORKDAY(INT(B6),1,Holidays)+(B6-INT(B6))
Named Ranges
NameRefers ToCells
BusEndTime=Sheet1!$B$2B6
BusStartTime=Sheet1!$B$1B6
Holidays=Sheet1!$E$2:$E$4B6:C6
 
Upvote 0
Ok, I worked it out

Book5
ABCDE
18:00 AMHolidays
211:00 PM1/1/2021
37/4/2021
48/16/2021
5Ticket Rec'd TimeStart TimeTarget Time
68/13/2021 23:308/17/2021 8:008/18/2021 8:00
7
Sheet1
Cell Formulas
RangeFormula
B6B6=IF(WORKDAY(INT(A6)-1,1,Holidays)<>INT(A6),WORKDAY(INT(A6)-1,1,Holidays),IF((A6-INT(A6))>BusEndTime,WORKDAY(INT(A6),1,Holidays),INT(A6)))+IF(AND(BusStartTime<=(A6-INT(A6)),(A6-INT(A6))<=BusEndTime),(A6-INT(A6)),BusStartTime)
C6C6=WORKDAY(INT(B6),1,Holidays)+(B6-INT(B6))
Named Ranges
NameRefers ToCells
BusEndTime=Sheet1!$B$2B6
BusStartTime=Sheet1!$B$1B6
Holidays=Sheet1!$E$2:$E$4B6:C6
 
Upvote 0
Thanks for that and appreciate the quick turnaround. I have tried it and it works however some components remain outstanding. For example:

Since it is 24/7 between Monday 8am start to Friday 11pm finish there should not be a reset - just + 24 hours. At present, tickets that are arriving before 8am on a weekday are resetting to a start time of 8am.

Eg:
If i receive a ticket on Wednesday 02:45, then i have until Thursday 02:45
If i receive a ticket on Tuesday 14:30, then i have until Wednesday 14:30
If i receive a ticket on Friday 23:30, then i have until Tuesday 08:00 (Monday 08:00 is the effective start time)
If i receive a ticket on Saturday 04:30, then i have until Tuesday 08:00 (Monday 08:00 is the effective start time)
If i receive a ticket on Sunday 15:30, then i have until Tuesday 08:00 (Monday 08:00 is the effective start time).

Is it possible to rather than have an extra column, go directly from the received ticket time to start time to target time (ie. remove the start time column so i am left with just the received time column and target time).
 
Upvote 0
Thanks for that and appreciate the quick turnaround. I have tried it and it works however some components remain outstanding. For example:

Since it is 24/7 between Monday 8am start to Friday 11pm finish there should not be a reset - just + 24 hours. At present, tickets that are arriving before 8am on a weekday are resetting to a start time of 8am.

Eg:
If i receive a ticket on Wednesday 02:45, then i have until Thursday 02:45
If i receive a ticket on Tuesday 14:30, then i have until Wednesday 14:30
If i receive a ticket on Friday 23:30, then i have until Tuesday 08:00 (Monday 08:00 is the effective start time)
If i receive a ticket on Saturday 04:30, then i have until Tuesday 08:00 (Monday 08:00 is the effective start time)
If i receive a ticket on Sunday 15:30, then i have until Tuesday 08:00 (Monday 08:00 is the effective start time).

Is it possible to rather than have an extra column, go directly from the received ticket time to start time to target time (ie. remove the start time column so i am left with just the received time column and target time).
Ok, I will look at this. Yes I can make it only two columns "Ticket Rec'd" and "Target"
 
Upvote 0
Ok, I posted late last night but realized that I had some issues I needed to correct. Please check the yellow highlighted cells as I wasn't sure which way you wanted to got there. The scenario is that a ticket is received either on Thursday after 11:00 PM OR on Friday before 8:00 AM which would cause the Target Time to calculate to a day and time that was NOT in the business hours. In both cases I chose to make the target time calculate to Monday 8:00 AM. If that assumption is correct, I think this solves all cases. Please don't hesitate to reach out with ANY questions.

Leonidas75 20210813.xlsx
ABCD
1Ticket Rec'd TimeTarget TimeHolidays
2Mon 08/09/21 07:59 AMTue 08/10/21 08:00 AMFri 01/01/21
3Mon 08/09/21 08:00 AMTue 08/10/21 08:00 AMMon 01/18/21
4Mon 08/09/21 08:01 AMTue 08/10/21 08:01 AMMon 02/15/21
5Tue 08/10/21 10:00 AMWed 08/11/21 10:00 AMMon 05/31/21
6Tue 08/10/21 11:59 PMWed 08/11/21 11:59 PMSun 07/04/21
7Wed 08/11/21 07:30 AMThu 08/12/21 07:30 AMMon 07/05/21
8Wed 08/11/21 04:05 PMThu 08/12/21 04:05 PMMon 09/06/21
9Thu 08/12/21 12:01 PMFri 08/13/21 12:01 PMMon 10/11/21
10Thu 08/12/21 11:00 AMFri 08/13/21 11:00 AMThu 11/25/21
11Thu 08/12/21 11:00 PMMon 08/16/21 08:00 AMSat 12/25/21
12Thu 08/12/21 11:30 PMMon 08/16/21 08:00 AM
13Fri 08/13/21 05:00 AMMon 08/16/21 08:00 AM
14Fri 08/13/21 05:06 PMMon 08/16/21 05:06 PM
15Fri 08/13/21 11:01 PMTue 08/17/21 08:00 AM
16Sat 08/14/21 09:00 AMTue 08/17/21 08:00 AM
17Sun 08/15/21 04:20 PMTue 08/17/21 08:00 AM
18Named Formulas that must be created. You can copy these into the Name Manager directly if your first row of "Ticket Rec'd Time" is = A2. If it isn't remember to use the first cell of the "Ticket Rec'd Time" and anchor the column ONLY.
19AftBusHrsTgt=WORKDAY(INT(Sheet1!$A19),IF(WEEKDAY(INT(Sheet1!$A19),15)<4,2,1),Holidays)+BusStartTime
20BusEndTime=0.95833333
21BusHrsTgt=WORKDAY(INT(Sheet1!$A21),1,Holidays)+TktTimeRcd
22BusStartTime=0.33333333
23Holidays=Sheet1!$D$2:$D$11
24TktDTFriPreBus=AND(WEEKDAY(Sheet1!$A24,15)=1,TktTimeRcd<BusStartTime)
25TktDTThuAftBusFri=AND(WEEKDAY(Sheet1!$A25,14)=1,TktTimeRcd>BusEndTime)
26TktRcdAftBusHrs=OR(WORKDAY(INT(Sheet1!$A26)-1,1,Holidays)<>INT(Sheet1!$A26),WEEKDAY(Sheet1!$A26,16)<3,AND(WEEKDAY(Sheet1!$A26,16)=3,ROUND(Sheet1!$A26-INT(Sheet1!$A26),8)<BusStartTime),AND(WEEKDAY(Sheet1!$A26,2)=5,ROUND(Sheet1!$A26-INT(Sheet1!$A26),8)>BusEndTime))
27TktRcdThuAftFriPreBusHrs=WORKDAY(INT(Sheet1!$A27),IF(WEEKDAY(INT(Sheet1!$A27), 14)<2,2,1),Holidays)+BusStartTime
28TktTimeRcd=Sheet1!$A28-INT(Sheet1!$A28)
Sheet1
Cell Formulas
RangeFormula
B2:B17B2=IF(OR(TktDTThuAftBusFri,TktDTFriPreBus),TktRcdThuAftFriPreBusHrs,IF(TktRcdAftBusHrs,AftBusHrsTgt,BusHrsTgt))
Named Ranges
NameRefers ToCells
Holidays=Sheet1!$D$2:$D$11B2:B17
 
Upvote 0
Thanks for that, i will test this out during the day. Will this cover other scenarios such as

If ticket is received on say Tuesday at 02:35am the target time will be Wednesday 02:35am?
 
Upvote 0
Forgot to answer your highlighted rows - they would actually be +24 hours vs Monday 8am. Even though the Friday would have a Saturday target we should still be able to respond to tickets within the work day
 
Upvote 0
If ticket is received on say Tuesday at 02:35am the target time will be Wednesday 02:35am?
Yes see data above.

they would actually be +24 hours vs Monday 8am. Even though the Friday would have a Saturday target we should still be able to respond to tickets within the work day
So if a ticket is received

Thu 11:30 PM the target time should be Fri 11:30 PM?
Fri 7:00 AM the target time should be Sat 7:00 AM?

Even though these targets are outside business hours?

would it make more sense to make the Target time Fri 11:00 PM?
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,126
Members
452,381
Latest member
Nova88

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