Hello experts,
I'm a noob here and need help in this
I'm actually working on a tracker that has a cell to calculate the turnaround time (tat) which only shows the hours spent within the staff working hours.
Given 2 dates:
A2: Start date = 1/12/12 10:00
B2: End date = 1/16/12 15:00
Shift start time: 8:00 AM
Shift end time: 5:00 PM
Using this formula:
=IF(DAY(B2)-DAY(A2)=0,MIN("17:00",(B2-INT(B2)))-MAX("08:00",(A2-INT(A2))),(MIN("17:00",(B2-INT(B2)))-"08:00")+("17:00"-MAX("08:00",(A2-INT(A2))))+IF(DAY(B2)-DAY(A2)>1,(DAY(B2)-DAY(A2)-1)*(9/24),0))
Result:
In "[h]:mm" format = 41:00
I need the result to be in this format "x day(s) xx hour(s) and xx min" but when I format it, gave me "1 day(s) 17 hour(s) and 00 min".
As you can see, in normal calculation of shift start at 8AM, stop at 5PM. the time difference is 9 hours. And the result above should return "2 day(s) 08 hour(s) and 00 min".
Any idea on how to fix this? And these results should also able to be sum up or average out in my report. Any help is greatly appreciated.
Thank you.
P/S: Would be nice if the formula can only calculate 7.5 working hours and exclude weekends and holidays from the calculation
Bookmarks