# How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

Copper Contributor

# How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

Considering Two Set of Data

Start Date "A1=22-08-2019 11:55 AM"

End Date:- "B2=27-08-2019 5:00 PM"

Conditions:-

• Office working Hours is 10 AM - 7 PM
• Lunch is between 1 PM- 2 PM
• Saturday Sunday fixed off
• And a list of holiday

To Find:-

I want to find the number of hours it took to complete a Task considering working Hours..

7 Replies

# Re: How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

@Ateeb You've posted your question in the Community Discussion space, which is intended for discussion around the Tech Community website itself, not product questions.

Can you indicate which product your question is regarding? I'll be happy to suggest a space to post in and move your question there.

# Re: How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

Assuming that's Excel and assuming Start/End could be outside the working hours, for such sample

formula in C2 could be

``````=IF(INT(B2)>INT(A2),
NETWORKDAYS.INTL(A2+1,B2-1,"0000011",\$J\$2:\$J\$3)*8/24 +
(WORKDAY.INTL(A2-1,1,"0000011",\$J\$2:\$J\$3)=INT(A2))*
(
\$F\$2-MEDIAN(\$E\$2,\$F\$2,MOD(A2,1)) +
\$H\$2-MEDIAN(\$G\$2,\$H\$2,MOD(A2,1))
) +
(WORKDAY.INTL(B2-1,1,"0000011",\$J\$2:\$J\$3)=INT(B2))*
(
MEDIAN(\$E\$2,\$F\$2,MOD(B2,1))-\$E\$2 +
MEDIAN(\$G\$2,\$H\$2,MOD(B2,1))-\$G\$2
),
MIN(\$F\$2,MOD(B2,1))-MEDIAN(\$E\$2,\$F\$2,MOD(A2,1))+
MEDIAN(\$G\$2,\$H\$2,MOD(B2,1))-MAX(\$G\$2,MOD(A2,1))
)``````

Result formatted as [hh]:mm.

Firtst we check if Start/End dates are different days, if so calculate number of full workdays in between plus time for each of Start/End if only they are workdays. Finally calculate the difference if Start/End is the same date.

# Re: How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

I am getting negative values which is resulting in '######' being displayed as below. Could you please check and advise what needs to be done.

# Re: How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

@Ateeb Hello! I'm moving this to the Excel discussion space. Please post future Excel questions there. Thanks!

# Re: How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

Oops, too old formula. If to fix it, change in second line

NETWORKDAYS.INTL(...) on

MAX(0, NETWORKDAYS.INTL(...) )

Entire formula will be

``````=IF(INT(B2)>INT(A2),
MAX( 0,NETWORKDAYS.INTL(A2+1,B2-1,"0000011",\$J\$2:\$J\$3))*8/24 +
(WORKDAY.INTL(A2-1,1,"0000011",\$J\$2:\$J\$3)=INT(A2))*
(
\$F\$2-MEDIAN(\$E\$2,\$F\$2,MOD(A2,1)) +
\$H\$2-MEDIAN(\$G\$2,\$H\$2,MOD(A2,1))
) +
(WORKDAY.INTL(B2-1,1,"0000011",\$J\$2:\$J\$3)=INT(B2))*
(
MEDIAN(\$E\$2,\$F\$2,MOD(B2,1))-\$E\$2 +
MEDIAN(\$G\$2,\$H\$2,MOD(B2,1))-\$G\$2
),
MIN(\$F\$2,MOD(B2,1))-MEDIAN(\$E\$2,\$F\$2,MOD(A2,1))+
MEDIAN(\$G\$2,\$H\$2,MOD(B2,1))-MAX(\$G\$2,MOD(A2,1))
)``````

which gives

# Re: How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

@Sergei Baklan this is so helpful. Thanks for posting! Would it be a way to include those outside working hours? The formula works great withing working hours 9:00 to 13:00 and 14:00 to 18:00, but for those outside working hours return negative numbers. Thanks so much

# Re: How to calculate Turn Around Time (TAT) considering weekend and working Hours..!

like for example:

Received from RequesterReplied by 1st Level, where the working hours are 9:00 to 13:00 and 14:00 to 18:00

 2/2/2024 16:01 2/2/2024 16:21 2/2/2024 0:25 2/2/2024 11:00 1/31/2024 17:38 2/1/2024 16:56 2/1/2024 15:15 2/1/2024 15:15 1/10/2024 20:37 2/2/2024 16:11 2/1/2024 7:14 2/2/2024 13:40 2/1/2024 12:38 2/1/2024 13:19
 1/5/2024 7:28 1/5/2024 8:43