February 28, 2019
I have an excel file that contains labour information. A separate line is entered for each work order that is worked on for each employee for each day (each employee typically works on numerous work orders each day). Here are some of the pertinent columns contained on the labour tab "Labour 2017-2018":
Column A: Work order number.
Column D: Date.
Column H: Number of hours worked (on that work order on that date).
Column I: Overtime (blank = regular pay, "Y" = time & ½, "D" = double time).
On another tab, I am trying to generate a separate list of work orders for each of the three pay rates (regular, time & ½ & double time) that are worked for a specific week. I have a cell where you can enter a week ending date (C2). I have another cell (C3) that calculates the beginning of that particular week based on the date entered (C2 - 6). I have created the following items under 'Name Manager':
JC_Work_Order: Column 'A' of the labour tab.
JC_Date: Column 'D' of the labour tab.
JC_Labour_Info: The entire labour tab (column 'A' to column 'I' for all of the labour items that have been entered).
JC_Code: Column 'I' of the labour tab.
I need three separate lists to be generated (regular pay, time & ½ and double time). I also need each list to only show the work orders that have labour associated with them during the particular week. This means that if a particular work order only has double time labour and no regular or time & ½ it will only show up on the double time list. If a work order has both regular time as well as time & ½ it would show up on both regular and time & ½ lists. I currently have the following formula for generating the list of work orders for regular time:
=IFERROR(INDEX(JC_Work_Order, MATCH(0,COUNTIF($A$4:A4, IF(($C$2>=JC_Date)*($C$3<=JC_Date), JC_Work_Order, $A$4)), 0)), "")
I save the formula by pressing CTRL/SHIFT/ENTER and it seems to work but it includes all of the work orders that have labour during the specified period. Unfortunately, this includes work orders that do not have regular labour but do have either time & ½ or double time labour. These work orders show up on the list but obviously they do not have any regular labour associated with them. I have not been able to figure out how to amend this formula to remove these particular work orders.
In addition, I cannot figure out the formulas for the time & ½ and double time lists.
Once the three lists of work orders are generated successfully, I want to calculate the number of hours that each employee works on each work order during that particular week. I currently have the following formula for calculating the regular hours worked:
=SUMIFS('Labour 2017-2018'!$H:$H,'Labour 2017-2018'!$C:$C,"="&C$4,'Labour 2017-2018'!$A:$A,"="&$A5,'Labour 2017-2018'!$D:$D,">="&$C$3,'Labour 2017-2018'!$D:$D,"<="&$C$2,'Labour 2017-2018'!$I:$I,"<>Y",'Labour 2017-2018'!$I:$I,"<>D")
This formula appears to be working properly. The entire Excel file is very large and I would prefer not to publish it online so I am hopeful that the information that I have provided will be sufficient for someone to understand what I am trying to do and potentially provide the three formulas that I need.
Any assistance with this would be greatly appreciated.
February 28, 2019
Creating unique cells using criteria is different and there are multiple ways to do this. Fix Error code 0X0070002 helped me to get the detail of this.