Find the time difference

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
343
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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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,223,911
Messages
6,175,334
Members
452,636
Latest member
laura12345

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