Hello all. Could use your help in figuring out this formula.
I have a large data set (700,00 + rows). Within that data set there are Part_Work_Orders (column B). Multiple rows within the data set consist of the same value for Part_Work_Orders. These parts go through several steps, which is represented by Route_Step_Num (column O). Each step takes a certain amount of time, which is represented by Step_Complete_Time_Date (column M).
What I need is a formula that:
I have a large data set (700,00 + rows). Within that data set there are Part_Work_Orders (column B). Multiple rows within the data set consist of the same value for Part_Work_Orders. These parts go through several steps, which is represented by Route_Step_Num (column O). Each step takes a certain amount of time, which is represented by Step_Complete_Time_Date (column M).
What I need is a formula that:
- For the first step of each unique Part_Work_Order (column B) we want to take Step_Complete_Date_Time (column M) and subtract Date_Created (column E) to return the amount of time. The first step of each unique Part_Work_Order (column B) can be determined by the lowest value of Route_Step_Num (column O) [this value is not always = 1]
- For each of the remaining steps for each unique Part_Work_Order (column B) we want to calculate the amount of time from one step to the next. For instance, after the first step is calculated (as outlined above), we would want to look for the next sequential Route_Step_Num (column O) associated with that unique Part_Work_Order (column B). This time calculation would be determined by taking the difference of the Step_Complete_Time_Date (column M) of the two steps. If the larger Route_Step_Num does not have a value in Step_Complete_Time_Date (column M) we would want to use the Now() function. [certain Route_Step_Num numbers are skipped; for example a unique part may have Route_Step_Num 2, 3, 6, 9, 10 --- we would want to know the time from step 2 to 3, 3 to 6, 6 to 9, and finally 9 to 10].