Excel - Comparing specific date and times

HeyYoWL

New Member
Joined
Aug 1, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I'm trying to create a tracker that contains a column to check if we've met SLA.

Column A - Date Received
Column B - Time Received
Column C - Date and Time Combined (A2+B2)
Column D - Date Resolved
Column E - Time Resolved
Column F - Date and Time Resolved (D2+E2)

Essentially, what I need to check is:

If the date received (Column A) and time received (Column B) was after 12 PM, the date resolved (Column D) should be the next business day by 12 PM (Column E).

Ex: Received request at 2pm on Monday July 31st, resolved Tuesday August 1st at 11 AM -> SLA Met

Ex: Received request at 2pm on Monday July 31st, resolved Tuesday August 1st at 3 PM -> SLA Not Met

I can't figure out how to combine the date and time data to plug into my formula. I've tried combining the date and time as you can see above:

=IF(AND(O2="Team Inbox", C2 >= TIME(12,0,0)), NETWORKDAYS(A2,E2,Holidays[2023Holidays])<=2, G2 <= TIME(12,0,0)), "Yes", "No")

Column O = Specific Inbox [2023Holidays] = Table of holidays for business

Any help would be appreciated!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
So what happens if the thing is received before noon on a given day?

MrExcelPlayground19.xlsx
ABCDEFGHIJKLMNO
1Date Receivedtime ereceivedDate/time receivedDate ResolvedTime ResolvedDate/time ResolvedGood?
27/31/20232:00 PMMon 7/31/2023 14:008/1/202311:00 AMTue 8/1/2023 11:00SLA MetSunday, January 1, 2023
37/31/20232:00 PMMon 7/31/2023 14:008/2/20233:00 PMWed 8/2/2023 15:00SLA Not MetMonday, January 16, 2023
48/2/20232:00 PMWed 8/2/2023 14:008/3/20231:00 PMThu 8/3/2023 13:00SLA Not MetMonday, February 20, 2023
58/3/202310:00 AMThu 8/3/2023 10:008/4/20232:00 PMFri 8/4/2023 14:00What if it's received before noon?Monday, May 29, 2023
68/4/202311:00 AMFri 8/4/2023 11:008/4/20233:00 PMFri 8/4/2023 15:00What if it's received before noon?Monday, June 19, 2023
72/17/20232:00 PMFri 2/17/2023 14:002/21/202311:00 AMTue 2/21/2023 11:00SLA MetTuesday, July 4, 2023
811/22/20233:00 PMWed 11/22/2023 15:0011/27/202310:00 AMMon 11/27/2023 10:00SLA MetMonday, September 4, 2023
9Thursday, October 12, 2023
10Monday, November 6, 2023
11Saturday, November 11, 2023
12Thursday, November 23, 2023
13Friday, November 24, 2023
14Monday, December 25, 2023
Sheet14
Cell Formulas
RangeFormula
F2:F8,C2:C8F2=D2+E2
G2:G8G2=IF(B2>0.5,IF(AND(NETWORKDAYS.INTL(A2,D2,1,$O$2:$O$14)<=2,E2<=0.5),"SLA Met","SLA Not Met"),"What if it's received before noon?")
 
Upvote 0
So what happens if the thing is received before noon on a given day?

Hi James,

This is tracking emails to that specific inbox, Column O is tracking which inbox it's going to. So if we receive an email before noon, it's due by the end of the day. I already have the other portions of that done, it was just this last bit I needed help with, didn't want to make it longer than necessary but I can. Here's the full scope of the situation:

There are 2 inboxes, defined in Column O by dropdown options for "Team Inbox" or Other "Team Inbox"

- Other Team Inbox, SLA is 2 business days - formula working (green font)
- Team Inbox, if email received before 12 PM, must resolve by same day - formula working (blue font)
- Team Inbox, if email received after 12 PM, must resolve by 12 pm the next business day - formula not working (orange font)

=IF(OR(AND(O2="Other Team Inbox", NETWORKDAYS(A2,D2,Holidays[2023Holidays])<=3), (AND(O2="Team Inbox", B2 <= TIME(12,0,0), NETWORKDAYS(A2,E2,Holidays[2023Holidays])<=1)), AND(O2="Other Team Inbox", C2 >= TIME(12,0,0), F2 <= TIME(12,0,0), NETWORKDAYS(A2,E2,Holidays[2023Holidays])<=2)), "Yes", "No")
 
Upvote 0
I gave this a try and it runs into the same issue I had with an earlier formula, in that it only takes into account the time and not the date as well. If you look at that 1st row of data, if you leave the date and time received as is, but change D2 to 7/31 and E2 to 9 PM, it says "SLA Not Met". So even though it's within SLA, because it's not looking at the day as well it shows Not Met.
 
Upvote 0
RIght you are...
MrExcelPlayground19.xlsx
ABCDEFGHIJKLMNO
1Date Receivedtime ereceivedDate/time receivedDate ResolvedTime ResolvedDate/time ResolvedGood?
27/31/20232:00 PMMon 7/31/2023 14:007/31/20239:00 PMMon 7/31/2023 21:00SLA MetSunday, January 1, 2023
37/31/20232:00 PMMon 7/31/2023 14:008/2/20233:00 PMWed 8/2/2023 15:00SLA Not MetMonday, January 16, 2023
48/2/20232:00 PMWed 8/2/2023 14:008/3/202311:00 AMThu 8/3/2023 11:00SLA MetMonday, February 20, 2023
58/3/202310:00 AMThu 8/3/2023 10:008/4/20232:00 PMFri 8/4/2023 14:00SLA Not MetMonday, May 29, 2023
68/4/202311:00 AMFri 8/4/2023 11:008/4/20233:00 PMFri 8/4/2023 15:00SLA MetMonday, June 19, 2023
72/17/20232:00 PMFri 2/17/2023 14:002/21/202311:00 AMTue 2/21/2023 11:00SLA MetTuesday, July 4, 2023
811/22/20233:00 PMWed 11/22/2023 15:0011/27/202310:00 AMMon 11/27/2023 10:00SLA MetMonday, September 4, 2023
9Thursday, October 12, 2023
10Monday, November 6, 2023
11Saturday, November 11, 2023
12Thursday, November 23, 2023
13Friday, November 24, 2023
14Monday, December 25, 2023
Sheet14
Cell Formulas
RangeFormula
F2:F8,C2:C8F2=D2+E2
G2:G8G2=IF(NETWORKDAYS.INTL(A2,D2,1,$O$2:$O$14)+E2<=2.5,"SLA Met","SLA Not Met")
 
Upvote 0
RIght you are...
We're getting somewhere! That works, but when I plug into my existing formula, emails sent before 12 PM aren't working now. Anything sent before 12 PM should be resolved on the same business day.

Ex: A2=8/1/23, B2=11 AM, D2= 8/1/23, E2 = 11:59 PM -> SLA Met
Ex: A2=8/1/23, B2=11 AM, D2= 8/2/23, E2 = 10 AM -> SLA Not Met

Right now I have:

=IF(OR(AND(O2="Team Inbox", B2 <= TIME(12,0,0), NETWORKDAYS(A2,D2,Holidays[2023 Holidays])<=1), AND(M2="PL Cares", NETWORKDAYS(A2,D2,Holidays[F''23])+E2<=2.5)), "Yes", "No")

Can we combine into one formula:

- If received before 12 PM, response = same business day
- If received after 12 PM, response = next business day before 12 PM

Right now the formula calculating only if it was resolved by 12 PM the next business day.
 
Upvote 0
We will get there.
MrExcelPlayground19.xlsx
ABCDEFGHIJKLMNO
1Date Receivedtime ereceivedDate/time receivedDate ResolvedTime ResolvedDate/time ResolvedGood?
27/31/20232:00 PMMon 7/31/2023 14:007/31/20239:00 PMMon 7/31/2023 21:00SLA MetSunday, January 1, 2023
37/31/20232:00 PMMon 7/31/2023 14:008/2/20233:00 PMWed 8/2/2023 15:00SLA Not MetMonday, January 16, 2023
48/2/20232:00 PMWed 8/2/2023 14:008/3/202311:00 AMThu 8/3/2023 11:00SLA MetMonday, February 20, 2023
58/3/202310:00 AMThu 8/3/2023 10:008/4/202310:00 AMFri 8/4/2023 10:00SLA Not MetMonday, May 29, 2023
68/4/202311:00 AMFri 8/4/2023 11:008/4/20233:00 PMFri 8/4/2023 15:00SLA MetMonday, June 19, 2023
72/17/20232:00 PMFri 2/17/2023 14:002/21/202311:00 AMTue 2/21/2023 11:00SLA MetTuesday, July 4, 2023
811/22/20233:00 PMWed 11/22/2023 15:0011/27/202310:00 AMMon 11/27/2023 10:00SLA MetMonday, September 4, 2023
9Thursday, October 12, 2023
10Monday, November 6, 2023
11Saturday, November 11, 2023
12Thursday, November 23, 2023
13Friday, November 24, 2023
14Monday, December 25, 2023
Sheet14
Cell Formulas
RangeFormula
F2:F8,C2:C8F2=D2+E2
G2:G8G2=IF(B2>=0.5,IF(NETWORKDAYS.INTL(A2,D2,1,$O$2:$O$14)+E2<=2.5,"SLA Met","SLA Not Met"),IF(NETWORKDAYS.INTL(A2,D2,1,$O$2:$O$14)=1,"SLA Met","SLA Not Met"))
 
Upvote 0
Solution
Great, it works, thanks a bunch! Now just because I like to learn for next time, would you mind explaining how this works? I get most of it but what about:

+E2<=2.5

and =1

Makes all this work?
 
Upvote 0
networkdays between two adjacent dates will result in a 2. the time in Column E turns into a fraction of a day. So noon is 0.5. adding that to the networkdays and you are looking for a number that is less than or equal to 2.5 - noon on the second day. So if something comes in at 1pm, and gets done by 5 on the same day, it'll come to 1+17/24 which is less than or equal to 2.5 too.

The =1 means that the networkdays are the same day.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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