I need to get the difference between two date-time cells in hours considering only weekdays.
Example:
25/02/2018 16:00:00 | 26/04/2018 09:00:00 | 19:00:00
I need to get the difference between two date-time cells in hours considering only weekdays.
Example:
25/02/2018 16:00:00 | 26/04/2018 09:00:00 | 19:00:00
=( COUNTIF(ARRAYFORMULA( WEEKDAY(ROW(INDIRECT("a1:a"&INT(B1)-int(A1)-1))+ int(A1), 2) ), "<6") + IF(WEEKDAY(B1,2)<6,B1 - INT(B1),0) - if(WEEKDAY(A1,2)<6,A1-INT(A1),0) )*24
counts:
Using network days:
This says count working days from first date to second date inclusive.
If first date is a working day, subtract hours not worked before start time.
If second date is a working day, subtract hours not worked after finish time.
Strictly speaking, you should also check that start datetime is before finish datetime.