Calculate time at a specific step based on multiple criteria

JPEliz_Sx

New Member
Joined
Oct 29, 2021
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
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:

  1. 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]
  2. 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].
Thank you for your time and consideration with our struggle.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    35 KB · Views: 7

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top