Find the time difference

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
350
Office Version
  1. 365
Platform
  1. Windows
Find the difference in minutes excluding the weekends and out of working time

example, ticket was created Friday at 7:50 pm and was completed Monday at 8:20.

Work starts at 8am and ends at 8pm

The result should be 30min (10 min from 7:50pm and 20min to 8:20am
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This seems to do it.

EXCEL
ABC
15/10/2024 19:5030
25/13/2024 8:20
Sheet2
Cell Formulas
RangeFormula
C1C1=LET(dif,(A2-A1)*1440+1,dt,SEQUENCE(dif,,A1,1/24/60),dow,WEEKDAY(dt,2),h,HOUR(dt),SUMPRODUCT((dow<6)*(h>=8)*(h<20))-1)
 
Upvote 0
Solution
This seems to do it.

EXCEL
ABC
15/10/2024 19:5030
25/13/2024 8:20
Sheet2
Cell Formulas
RangeFormula
C1C1=LET(dif,(A2-A1)*1440+1,dt,SEQUENCE(dif,,A1,1/24/60),dow,WEEKDAY(dt,2),h,HOUR(dt),SUMPRODUCT((dow<6)*(h>=8)*(h<20))-1)
it works.. thank you
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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