Non productive hours calculation

Copper Contributor

From the attached data, if any employee on leave then non productive hours should be blank or shoud not take into consideration and for rest sum of NPT hours to be calculated.

 

NameCodeDateTimes - Start TimeTimes - Stop TimeTimes - DurationNPT Time
EMeeting5/1/202312:0012:150:150.25
ESL5/1/202309:0018:008:008
EMeeting5/1/202316:0016:150:150.25
BMeeting5/1/202309:0009:190:190.316667
BMeeting5/1/202312:0012:150:150.25
BPL5/2/202309:0018:008:008
BMeeting5/2/202316:0016:150:150.25
HSHIFT5/1/202309:0018:009:009
HTraining5/1/202312:0012:150:150.25
HPL5/2/202309:0018:008:008
IMeeting5/1/202316:0016:150:150.25
KSHIFT5/1/202309:0018:009:009
KTraining5/1/202312:0012:150:150.25
KCL5/3/202309:0018:008:008
KMeeting5/1/202316:0016:150:150.25
FTraining5/1/202312:0012:150:150.25
FSL5/1/202309:0018:008:008
FMeeting5/1/202316:0016:150:150.25
GTraining5/1/202312:0012:150:150.25
GCL5/1/202309:0018:008:008
GMeeting5/1/202316:0016:150:150.25
JTraining5/1/202312:0012:150:150.25
JPL5/1/202309:0018:008:008
JMeeting5/1/202316:0016:150:150.25
CMeeting5/1/202312:0012:150:150.25
CCL5/3/202309:0018:008:008
CMeeting5/1/202316:0016:150:150.25
IMeeting5/1/202312:0012:150:150.25
ISL5/1/202309:0018:008:008
IMeeting5/1/202316:0016:150:150.25
DSHIFT5/1/202309:0018:009:009
DMeeting5/1/202312:0012:150:150.25
DSL5/4/202309:0018:008:008
DMeeting5/1/202316:0016:150:150.25
AMeeting5/1/202312:0012:150:150.25
ASL5/1/202309:0018:008:008
AMeeting5/1/202316:0016:150:150.25

 

4 Replies

@reshambahadur 

 

NameCodeDateTimes - Start TimeTimes - Stop TimeTimes - DurationNPT TimeActual AHT
EMeeting5/1/202312:0012:150:150.250.00
ESL5/1/202309:0018:008:0080.00
EMeeting5/1/202316:0016:150:150.250.00
BMeeting5/1/202309:0009:190:190.3166670.32
BMeeting5/1/202312:0012:150:150.250.25
BPL5/2/202309:0018:008:008 
BMeeting5/2/202316:0016:150:150.25 
HSHIFT5/1/202309:0018:009:009 
HTraining5/1/202312:0012:150:150.25 
HPL5/2/202309:0018:008:008 
IMeeting5/1/202316:0016:150:150.25 
KSHIFT5/1/202309:0018:009:009 
KTraining5/1/202312:0012:150:150.25 
KCL5/3/202309:0018:008:008 
KMeeting5/1/202316:0016:150:150.25 
FTraining5/1/202312:0012:150:150.25 
FSL5/1/202309:0018:008:008 
FMeeting5/1/202316:0016:150:150.25 
GTraining5/1/202312:0012:150:150.25 
GCL5/1/202309:0018:008:008 
GMeeting5/1/202316:0016:150:150.25 
JTraining5/1/202312:0012:150:150.25 
JPL5/1/202309:0018:008:008 
JMeeting5/1/202316:0016:150:150.25 
CMeeting5/1/202312:0012:150:150.25 
CCL5/3/202309:0018:008:008 
CMeeting5/1/202316:0016:150:150.25 
IMeeting5/1/202312:0012:150:150.25 
ISL5/1/202309:0018:008:008 
IMeeting5/1/202316:0016:150:150.25 
DSHIFT5/1/202309:0018:009:009 
DMeeting5/1/202312:0012:150:150.25 
DSL5/4/202309:0018:008:008 
DMeeting5/1/202316:0016:150:150.25 
AMeeting5/1/202312:0012:150:150.25 
ASL5/1/202309:0018:008:008 
AMeeting5/1/202316:0016:150:150.25 

@reshambahadur 

To calculate the sum of non-productive hours (NPT hours) for each employee in Excel, you can follow these steps:

  1. Open the Excel file and navigate to a new worksheet.
  2. Copy the provided data into columns A to F, starting from row 2. Make sure the headers are included.
  3. In cell G2, enter the following formula to check if the employee is on leave:

=IF(OR(B2="SL", B2="PL", B2="CL"), "", SUM(E2:F2))

 

  1. This formula checks if the code (column B) is "SL", "PL", or "CL". If it is, the cell will be blank. Otherwise, it will sum the values in columns E and F, which represent the NPT Time.
  2. Drag the formula in cell G2 down to apply it to the remaining rows.
  3. In cell H2, enter the following formula to calculate the sum of NPT hours for each employee:

=SUMIF(A:A, A2, G:G)

  1. This formula uses the SUMIF function to sum the NPT hours (column G) for each unique employee name (column A).
  2. Drag the formula in cell H2 down to apply it to the remaining rows.

Now, you should have the sum of NPT hours for each employee in column H. The cells corresponding to employees on leave will be blank.

@NikolinoDE 

 

For example:

IF "A" employee has three codes in May 1st, 2023, Meeting, Huddle and SL then all 3 NPT should be blank

IF "B" Employee has three codes in May 1. 2023.... Meeting 30 mins, Hudlle-20 mins and Training-10 mins

then the total NPT should be 1 hr 

 

 

@reshambahadur 

To calculate the total NPT (Non-Productive Time) for each employee in Excel, you can use the SUMIFS function to sum the durations based on multiple criteria. Here's an example formula you can use:

Assuming the data is in columns A to G, and the NPT Time is in column F, you can enter the following formula in cell H2:

=IF(AND(COUNTIFS($A$2:$A$33, $A2, $G$2:$G$33, "<>")>1, $F2=""), "", SUMIFS($F$2:$F$33, $A$2:$A$33, $A2, $G$2:$G$33, "<>")/60)

This formula checks if an employee has multiple codes on the same date and if the NPT Time is blank. If both conditions are met, it returns an empty string ("") to display a blank value. Otherwise, it sums the NPT Time (converted to hours by dividing by 60) for the employee using the SUMIFS function.

Copy the formula down for the remaining rows to calculate the total NPT for each employee.

Make sure to adjust the range references ($A$2:$A$33, $G$2:$G$33, $F$2:$F$33) in the formula to match the actual range of your data.

Note: The example assumes that the NPT Time is in the format of hours and minutes (e.g., 0:15 for 15 minutes). If your data is in a different format, you may need to adjust the formula accordingly.