I need to create a formula to compare two dates, for example: 2015-05-13 18:00:00 and 14/05/2015 08:30:00. As I want to compare the dates only for business working hours (Monday to Friday - 8:00 to 18:00), the difference for this example should be 30 minutes.
I've tried this formula:
=IF(AND(INT(J62)=INT(K62),NOT(ISNA(MATCH(INT(J62),0)))),0,ABS(IF(INT(J62)=INT(K62),ROUND(24*(K62-J62),2),(24*('Business Hours'!$A$3-'Business Hours'!$A$2)(MAX(NETWORKDAYS(J62+1,K62-1),0)+INT(24(((K62-INT(K62))-(J62-INT(J62)))+('Business Hours'!$A$3-'Business Hours'!$A$2))/(24*('Business Hours'!$A$3-'Business Hours'!$A$2))))+MOD(ROUND(((24*(K62-INT(K62)))-24*'Business Hours'!$A$2)+(24*'Business Hours'!$A$3-(24*(J62-INT(J62)))),2),ROUND((24*('Business Hours'!$A$3-'Business Hours'!$A$2)),2))))))
But this formula is not giving me the expected result, as it is returning 10.5.
I have the business hours on a 'Business Hours'A2(Start) and 'Business Hours'A3(End)
01/01/2015 10:35, cell A2 with01/01/2015 15:30:00, and cell A3 with=(B1-A1)*1440. In A3 you should see the value 295 (minutes between A2 and A1). Use now the formula in your Excel. - Tarod