Calculate the total TAT hours by excluding the non-working hours, weekends and declared holidays

pvk_79

New Member
Joined
Jan 29, 2013
Messages
17
Hi All

I want to calculate the total TAT hours (refer column E) by excluding the non-working hours, weekends and declared holidays.

Non-workings hours are – 6:01 PM to 2:59 AM EST
Working hours for us – 3 AM to 6 PM EST
Weekends – every Saturday and Sunday

A B C D E F
Creation TimeClosed TimeWorking hours - startWorking hours - endTATHolidays
12/21/2012 17:3512/24/2012 6:243:0018:0015:001/1/2013
12/21/2012 21:5912/24/2012 6:413:0018:0015:001/21/2013
12/21/2012 15:2412/24/2012 6:503:0018:0015:005/27/2013
12/21/2012 16:1212/24/2012 6:533:0018:00Not Met TAT7/4/2013
12/21/2012 22:3012/24/2012 7:143:0018:00Not Met TAT9/2/2013
12/21/2012 23:0912/24/2012 8:093:0018:00Not Met TAT11/28/2013
12/21/2012 22:2512/24/2012 8:363:0018:00Not Met TAT11/29/2013
12/22/2012 9:4912/24/2012 8:593:0018:00Not Met TAT12/25/2013

<tbody>
</tbody><colgroup><col span="2"><col span="2"><col><col></colgroup>


Your help will be highly appreciated. Thanks in advance.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
This doesn't work ... =(NETWORKDAYS(A2,B2)-1)*(D2-C2)+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1),D2,C2),D2)-MEDIAN(NETWORKDAYS(B2,B2)*MOD(B2,1),D2,C2)
 
Upvote 0
Hi - Would you please suggest any pointers. I've gone through the posts available on this portal related to TAT and tried to collect the info in bits and pieces however the final formulae doesn't seem working for me.....

Thanks a lot in advance
 
Upvote 0
=(NETWORKDAYS(A2,B2)-1)*(D2-C2)+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1),D2,C2),D2)-MEDIAN(NETWORKDAYS(B2,B2)*MOD(B2,1),D2,C2)

This looks right to me, although you need to insert the holiday range into all 3 NETWORKDAYS functions. If you do that and you still get incorrect results then can you give a specific example where you don't get what you expect
 
Upvote 0
Thank you Barry, I missed that earlier hence it has been corrected now .....

=(NETWORKDAYS(A2,B2,F2:F9)-1)*(D2-C2)+IF(NETWORKDAYS(B2,B2,F2:F9),MEDIAN(MOD(B2,1),D2,C2),D2)-MEDIAN(NETWORKDAYS(B2,B2,F2:F9)*MOD(B2,1),D2,C2)

however I'm still facing the problems -

i.e. please have a look at the last row - the start time is 12/22/2012 9:49:00 AM and end time is 12/24/2012 8:59:00 AM, hence the TAT should be roughly 6 hours however its shows zero to me ... can you please guide me here in case I'm doing something wrong....

I also checked the other rows and it shows wrong calculations of TAT
i.e. row 2 has start time 12/21/2012 5:35:00 PM and end time 12/24/2012 6:24:00 AM hence TAT should be roughly 4 hours however its still shows 15 hours TAT

The TAT cell is in H:MM format ...
 
Upvote 0
=(NETWORKDAYS(A2,B2,F2:F9)-1)*(D2-C2)+IF(NETWORKDAYS(B2,B2,F2:F9),MEDIAN(MOD(B2,1),D2,C2),D2)-MEDIAN(NETWORKDAYS(B2,B2,F2:F9)*MOD(B2,1),D2,C2)

Actually, yes, you have some references to B2 which should be A2 - those marked in red
 
Upvote 0
Hi Barry,

That's perfect! Thank you for your guidnace, appreciate all your help....

Cheers
Pankaj
 
Upvote 0
changed the holidays into a static array .....

=(NETWORKDAYS(A2,B2,{41275;41295;41421;41459;41519;41606;41607;41633})-1)*(D2-C2)+IF(NETWORKDAYS(B2,B2,{41275;41295;41421;41459;41519;41606;41607;41633}),MEDIAN(MOD(B2,1),D2,C2),D2)-MEDIAN(NETWORKDAYS(A2,A2,{41275;41295;41421;41459;41519;41606;41607;41633})*MOD(A2,1),D2,C2)
 
Upvote 0
Guys - BEWARE

I just checked and the above formulae has some problems when the TAT crosses 24 hours - I mean it gives wrong results
 
Upvote 0
To overcome this problem use the TAT cells strictly in [h]:mm format - will resolve this problem
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,235
Members
449,092
Latest member
SCleaveland

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