Lapsed days as hours and taking weekends in to consideration.

ayeready

New Member
Joined
Oct 26, 2018
Messages
18
Hi all

I'm trying to work out lapsed hours between 2 date stamps (Column H & Column N) that takes into account the possibility that a weekend will have a baring on the calculation.
This is what i have come up with to date but I've noticed that my calculation doesn't take in to consideration anything that has been notified over a weekend to then deduct the weekend time.

Anything received over the weekend (Saturday/Sunday) should have its lapsed days count begin at 09:00am on the following Monday morning.

Book1
HIJKLMN
1Date NotifiedDay NotifiedHoursWeekend MinusActual HoursActual HoursDate Received
221/11/2019 17:18:00Thursday24:2500:0024:251.01822/11/2019 17:43:43
301/11/2019 09:18:00Friday0:0700:000:070.00501/11/2019 09:25:33
401/11/2019 09:50:00Friday0:2100:000:210.01501/11/2019 10:11:11
501/11/2019 10:17:00Friday0:1800:000:180.01301/11/2019 10:35:01
701/11/2019 10:09:00Friday0:3100:000:310.02201/11/2019 10:40:12
801/11/2019 10:42:00Friday0:1000:000:100.00801/11/2019 10:52:58
901/11/2019 10:41:00Friday0:2600:000:260.01801/11/2019 11:07:10
1031/10/2019 09:49:00Thursday25:2800:0025:281.06101/11/2019 11:17:22
1601/11/2019 12:12:00Friday0:1700:000:170.01201/11/2019 12:29:12
1731/10/2019 16:22:00Thursday21:0200:0021:020.87701/11/2019 13:24:44
1901/11/2019 13:50:00Friday0:1900:000:190.01401/11/2019 14:09:42
2131/10/2019 10:05:00Thursday28:3700:0028:371.19201/11/2019 14:42:02
2231/10/2019 20:49:00Thursday18:3200:0018:320.77201/11/2019 15:21:17
2331/10/2019 15:59:00Thursday23:3300:0023:330.98201/11/2019 15:32:30
2401/11/2019 15:12:00Friday0:2400:000:240.01701/11/2019 15:36:02
2531/10/2019 09:09:00Thursday95:5048:0047:501.99404/11/2019 08:59:49
2702/11/2019 15:13:00Saturday42:0500:0042:051.75404/11/2019 09:18:48
3003/11/2019 12:38:00Sunday20:5200:0020:520.87004/11/2019 09:30:55
3531/10/2019 16:38:00Thursday89:3048:0041:301.73004/11/2019 10:08:53
3903/11/2019 21:22:00Sunday13:3000:0013:300.56304/11/2019 10:52:03
4502/11/2019 08:05:00Saturday52:1448:004:140.17604/11/2019 12:19:00
4601/11/2019 11:36:00Friday73:0648:0025:061.04604/11/2019 12:42:56
4801/11/2019 10:56:00Friday74:0348:0026:031.08604/11/2019 12:59:16
4903/11/2019 12:24:00Sunday25:0800:0025:081.04804/11/2019 13:32:48
Sheet1
Cell Formulas
RangeFormula
I2:I5, I7:I10, I16:I17, I19, I21:I25, I27, I30, I35, I39, I45:I46, I48:I49I2=TEXT(H2, "dddd")
J2:J5, J7:J10, J16:J17, J19, J21:J25, J27, J30, J35, J39, J45:J46, J48:J49J2=N2-H2
K2:K5, K7:K10, K16:K17, K19, K21:K25, K27, K30, K35, K39, K45:K46, K48:K49K2=IF(AND(OR(I2="Thursday",I2="Friday",I2="Saturday",I2="Sunday"),AND(J2>=2)),"48:00","00:00")
L2:L5, L7:L10, L16:L17, L19, L21:L25, L27, L30, L35, L39, L45:L46, L48:L49L2=J2-K2
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet1!$A$1:$AA$554I2:L5, I7:L10, I16:L17, I19:L19, I21:L25, I27:L27, I30:L30, I35:L35, I39:L39, I45:L46, I48:L49


Anyone have any ideas how to achieve this?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Managed to get it to work using a TODAY+TIME column that i will need to update weekly. Not perfect but works.

Book1
HIJKLMN
1Date NotifiedDay NotifiedWeekend ModifiedHoursWeekend MinusActual HoursDate Received
2702/11/2019 15:13:00Saturday04/11/2019 09:00:000:1800:000:1804/11/2019 09:18:48
Sheet1
Cell Formulas
RangeFormula
I27I27=TEXT(H27, "dddd")
J27J27=IF(OR(I27="Saturday",I27="Sunday"),(TODAY()-28)+TIME(9,0,0),0)
K27K27=IF(OR(I27="Saturday",I27="Sunday"),N27-J27,N27-H27)
L27L27=IF(AND(OR(I27="Thursday",I27="Friday",I27="Saturday",I27="Sunday"),AND(K27>=2)),"48:00","00:00")
M27M27=K27-L27
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet1!$A$1:$AA$553I27:M27
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,406
Members
448,958
Latest member
Hat4Life

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