Formula for Trun Around Time (TAT) For incident No Weekend

%3CLINGO-SUB%20id%3D%22lingo-sub-171029%22%20slang%3D%22en-US%22%3EFormula%20for%20Trun%20Around%20Time%20(TAT)%20For%20incident%20No%20Weekend%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-171029%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20need%20formula%20for%20Trun%20around%20Time%20(TAT)%20For%20Incident.%3C%2FP%3E%0A%3CP%3EFor%20Ex.%20Start%20Date%20Time%20%3A%2025%2F2%2F2018%2010%3A00%20AM%3C%2FP%3E%0A%3CP%3EEnd%20time%20%3A%2028%2F2%2F2018%206%3A00%20PM%3C%2FP%3E%0A%3CP%3EManual%20TAT%20calculation%20is%20%3A-%2053%3A00%3C%2FP%3E%0A%3CP%3EWorking%20hours%20for%20Sat%20to%20thu%20is%207%3A00%20Am%20to%2010%20Pm%26nbsp%3B%20%26amp%3B%20For%20Friday%20is%209%3A30%20AM%20to%206%3A30%20PM%3C%2FP%3E%0A%3CP%3ESo%20I%20need%20the%20Formula%20as%20per%20the%20Working%20hours%20and%20all%20days%20which%20calculate%20TAT.%3C%2FP%3E%0A%3CP%3ESo%20please%20help%20me%20thank%20you%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-171029%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20-%20formulas%20data%20worksheet%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20%26amp%3B%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-171065%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20Trun%20Around%20Time%20(TAT)%20For%20incident%20No%20Weekend%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-171065%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20data%20structured%20like%20this%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20597px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F30265i53EFE248FD0E9218%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ethe%20formula%20could%20be%3C%2FP%3E%0A%3CPRE%3E%3DNETWORKDAYS.INTL(F2%2B1%2CG2-1%2C%221111011%22)*9%2F24%20%2B%0A%20%20(INT(G2-1)-INT(F2%2B1)%2B1-NETWORKDAYS.INTL(F2%2B1%2CG2-1%2C%221111011%22))*15%2F24%20%2B%0A%20(IF(WEEKDAY(F2%2C2)%3D5%2C%24C%243%2C%24C%242)-MOD(F2%2C1)%20%2B%0A%20MOD(G2%2C1)-IF(WEEKDAY(G2%2C2)%3D5%2C%24B%243%2C%24B%242))%3C%2FPRE%3E%0A%3CP%3EI%20added%20helper%20cells%20for%20working%20hours%2C%20in%20general%20could%20be%20hardcoded%20using%20TIME()%20function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESample%20is%20attached.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-795854%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20Trun%20Around%20Time%20(TAT)%20For%20incident%20No%20Weekend%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-795854%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECould%20you%20please%20help%20me%20out%20to%20calculate%20TAT%20between%20particular%20time%20Windows.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3EShift%20Start%20Time%20EST%3C%2FTD%3E%3CTD%3EShift%20End%20Time%20EST%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3ESunday%208%3A30%20PM%3C%2FTD%3E%3CTD%3EMonday%205%3A30%20AM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EMonday%208%3A00%20AM%3C%2FTD%3E%3CTD%3EMonday%205%3A00%20PM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EMonday%208%3A30%20PM%3C%2FTD%3E%3CTD%3ETuesday%205%3A30%20AM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3ETuesday%208%3A00%20AM%3C%2FTD%3E%3CTD%3ETuesday%205%3A00%20PM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3ETuesday%208%3A30%20PM%3C%2FTD%3E%3CTD%3EWednesday%205%3A30%20AM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EWednesday%208%3A00%20AM%3C%2FTD%3E%3CTD%3EWednesday%205%3A00%20PM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EWednesday%208%3A30%20PM%3C%2FTD%3E%3CTD%3EThursday%205%3A30%20AM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EThursday%208%3A00%20AM%3C%2FTD%3E%3CTD%3EThursday%205%3A00%20PM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EThursday%208%3A30%20PM%3C%2FTD%3E%3CTD%3EFriday%205%3A30%20AM%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EFriday%208%3A00%20AM%3C%2FTD%3E%3CTD%3EFriday%205%3A00%20PM%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3EOrder_Date%3C%2FTD%3E%3CTD%3ECompleted_Date%3C%2FTD%3E%3CTD%3EManual%20TAT%20(Hours)%3C%2FTD%3E%3CTD%3ETAT%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E7%2F26%2F19%204%3A30%20AM%3C%2FTD%3E%3CTD%3E7%2F29%2F19%209%3A15%20PM%3C%2FTD%3E%3CTD%3E28%3A45%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E7%2F26%2F19%203%3A46%20PM%3C%2FTD%3E%3CTD%3E7%2F30%2F19%203%3A46%20PM%3C%2FTD%3E%3CTD%3E36%3A00%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E7%2F26%2F19%209%3A05%20PM%3C%2FTD%3E%3CTD%3E7%2F30%2F19%209%3A05%20PM%3C%2FTD%3E%3CTD%3E37%3A05%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E7%2F29%2F19%203%3A18%20PM%3C%2FTD%3E%3CTD%3E7%2F29%2F19%2011%3A00%20PM%3C%2FTD%3E%3CTD%3E4%3A12%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2260836%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20Trun%20Around%20Time%20(TAT)%20For%20incident%20No%20Weekend%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2260836%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3Bis%20it%20possible%20to%20exclude%20a%20list%20of%20national%20holidays%20in%20the%20calculation%20of%20TAT%3F%3C%2FP%3E%3CP%3EE.g.%2002%2F04%2F2021%20-%20Good%20Friday%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2261811%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20Trun%20Around%20Time%20(TAT)%20For%20incident%20No%20Weekend%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2261811%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1020349%22%20target%3D%22_blank%22%3E%40tyrelmiranda%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENETWORKDAYS.INTL()%20allows%20to%20define%20holidays%20as%204th%20parameter.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2618844%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20for%20Trun%20Around%20Time%20(TAT)%20For%20incident%20No%20Weekend%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2618844%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3Bhi%20your%20formula%20has%20been%20incredibly%20useful!%20thank%20you%20.%20my%20only%20problem%20is%20when%20i%20use%20your%20formula%20for%20start%20time%20being%20the%20day%20where%20teh%20working%20shift%20is%20longer%20(12.5%20hours)%20and%20the%20end%20time%20is%20the%20day%20of%20shorter%20hours%20(10.5%20hours)%20my%20result%20is%20giving%20me%202%20hours%20extra%3B%20example%20below%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Estart%20time%20(working%20hours%2012.5%20hours%20this%20day-%20so%2010%20hours%2015%20mins%20until%20end%20of%20day)%3C%2FP%3E%3CTABLE%20width%3D%22120%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22120%22%3E05%2F08%2F2021%2008%3A15%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eend%20time%20(start%20of%20day%20is%206am%20so%201%20hour%20and%2039%20minutes%20to%20completion%20so%20total%20time%20should%20be%2011%20hours%2054%20minutes%20but%20im%20getting%2013%20hours%2054%20minutes)%3C%2FP%3E%3CTABLE%20width%3D%22120%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22120%22%3E06%2F08%2F2021%2007%3A39%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Emy%20formula%26nbsp%3B%3C%2FP%3E%3CP%3E%3DNETWORKDAYS.INTL(L369%2B1%2CY369-1%2C%221111011%22)*10.5%2F24%2B(INT(Y369-1)-INT(L369%2B1)%2B1-NETWORKDAYS.INTL(L369%2B1%2CY369-1%2C%221111011%22))*12.5%2F24%20%2B(IF(WEEKDAY(L369%2C2)%3D5%2CSheet2!%24C%244%2CSheet2!%24C%243)-MOD(L369%2C1)%2BMOD(Y369%2C1)-IF(WEEKDAY(Y369%2C2)%3D5%2CSheet2!%24B%244%2CSheet2!%24B%243))%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi All,

 

I need formula for Trun around Time (TAT) For Incident.

For Ex. Start Date Time : 25/2/2018 10:00 AM

End time : 28/2/2018 6:00 PM

Manual TAT calculation is :- 53:00

Working hours for Sat to thu is 7:00 Am to 10 Pm  & For Friday is 9:30 AM to 6:30 PM

So I need the Formula as per the Working hours and all days which calculate TAT.

So please help me thank you

 

 

5 Replies

Hi,

 

With data structured like this

image.png

the formula could be

=NETWORKDAYS.INTL(F2+1,G2-1,"1111011")*9/24 +
  (INT(G2-1)-INT(F2+1)+1-NETWORKDAYS.INTL(F2+1,G2-1,"1111011"))*15/24 +
 (IF(WEEKDAY(F2,2)=5,$C$3,$C$2)-MOD(F2,1) +
 MOD(G2,1)-IF(WEEKDAY(G2,2)=5,$B$3,$B$2))

I added helper cells for working hours, in general could be hardcoded using TIME() function.

 

Sample is attached.

@Sergei Baklan 

 

Could you please help me out to calculate TAT between particular time Windows. 

 

Shift Start Time ESTShift End Time EST
Sunday 8:30 PMMonday 5:30 AM
Monday 8:00 AMMonday 5:00 PM
  
Monday 8:30 PMTuesday 5:30 AM
Tuesday 8:00 AMTuesday 5:00 PM
  
Tuesday 8:30 PMWednesday 5:30 AM
Wednesday 8:00 AMWednesday 5:00 PM
  
Wednesday 8:30 PMThursday 5:30 AM
Thursday 8:00 AMThursday 5:00 PM
  
Thursday 8:30 PMFriday 5:30 AM
Friday 8:00 AMFriday 5:00 PM

 

 

Order_DateCompleted_DateManual TAT (Hours)TAT
7/26/19 4:30 AM7/29/19 9:15 PM28:45 
7/26/19 3:46 PM7/30/19 3:46 PM36:00 
7/26/19 9:05 PM7/30/19 9:05 PM37:05 
7/29/19 3:18 PM7/29/19 11:00 PM4:12 

@Sergei Baklan is it possible to exclude a list of national holidays in the calculation of TAT?

E.g. 02/04/2021 - Good Friday

@tyrelmiranda 

NETWORKDAYS.INTL() allows to define holidays as 4th parameter.

@Sergei Baklan hi your formula has been incredibly useful! thank you . my only problem is when i use your formula for start time being the day where teh working shift is longer (12.5 hours) and the end time is the day of shorter hours (10.5 hours) my result is giving me 2 hours extra; example below 

 

start time (working hours 12.5 hours this day- so 10 hours 15 mins until end of day)

05/08/2021 08:15

 

end time (start of day is 6am so 1 hour and 39 minutes to completion so total time should be 11 hours 54 minutes but im getting 13 hours 54 minutes)

06/08/2021 07:39

 

 

my formula 

=NETWORKDAYS.INTL(L369+1,Y369-1,"1111011")*10.5/24+(INT(Y369-1)-INT(L369+1)+1-NETWORKDAYS.INTL(L369+1,Y369-1,"1111011"))*12.5/24 +(IF(WEEKDAY(L369,2)=5,Sheet2!$C$4,Sheet2!$C$3)-MOD(L369,1)+MOD(Y369,1)-IF(WEEKDAY(Y369,2)=5,Sheet2!$B$4,Sheet2!$B$3))