Difference between dates based on follow on work

Johnstone200

New Member
Joined
Apr 12, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am looking to preform a report on calculating the time difference between one work order closing, to the time it takes for the next work order to be raised based on the asset number. The conditions need to be a PCM closing to a CM being reported. For example I wish to calculate the difference between asset number 30619361, PCM finishing on the 28/12/2022 02:27:23, to the same asset CM being reported on the 04/07/2023 07:44.
Obviously I could do this Individually for each asset, but if there is a formula that can calculate for all the data so i can filter and pick out what is required that would be great.

Hope there is help out there.

Thanks
PCM query.xlsx
ABCDEFG
1assetnumpersongroupwonumworktypereportdateactstartactfinish
230619361SPEC-DWO-4898986PCM24/12/2022 09:5128/12/2022 02:2728/12/2022 02:27
330627005SPECWO-4916354PCM07/01/2023 12:4408/01/2023 09:0008/01/2023 10:00
430619362SPECWO-4917206PCM08/01/2023 11:1008/01/2023 07:0008/01/2023 08:00
530618897SPECWO-4917231PCM08/01/2023 12:0008/01/2023 13:3008/01/2023 14:30
630619304SPECWO-4917235PCM08/01/2023 12:0218/01/2023 14:5818/01/2023 14:58
730619294SPECWO-4928321PCM17/01/2023 11:2318/02/2023 10:0018/02/2023 11:00
830627014SPECWO-4935937PCM23/01/2023 10:5423/01/2023 10:0023/01/2023 11:00
930619100SPECWO-4936041PCM23/01/2023 12:5325/01/2023 12:3025/01/2023 14:30
1030627017SPECWO-4983733PCM28/02/2023 23:2406/03/2023 08:0006/03/2023 09:00
1130628847SPECWO-5053149PCM26/04/2023 14:3330/04/2023 14:0002/06/2023 15:00
1230645547SPECWO-5056130PCM28/04/2023 12:0627/06/2023 04:3127/06/2023 04:31
1330626989SPECWO-5056157PCM28/04/2023 12:4829/04/2023 08:3029/04/2023 11:00
1430619346SPECWO-5057447PCM29/04/2023 14:1503/05/2023 16:0003/05/2023 17:00
1530618898SPECWO-5067748PCM07/05/2023 03:1213/05/2023 12:0513/05/2023 12:05
1630628860SPECWO-5077466PCM15/05/2023 10:5417/05/2023 11:3017/05/2023 12:30
1730619072SPECWO-5085005PCM21/05/2023 11:4302/06/2023 14:3002/06/2023 16:00
1830618792SPECWO-5086122PCM22/05/2023 14:2223/05/2023 12:0023/05/2023 13:45
1930644583SPECWO-5086123PCM22/05/2023 14:2323/05/2023 12:0023/05/2023 15:00
2030619083SPECWO-5092924CM28/05/2023 06:2728/05/2023 07:0028/05/2023 08:00
2130626985SPECWO-5092933CM28/05/2023 06:4728/05/2023 10:0028/05/2023 10:30
2230626991SPEC-DWO-5095155PCM30/05/2023 11:2522/06/2023 02:5922/06/2023 02:59
2330619352SPECWO-5097659PCM31/05/2023 10:4731/05/2023 11:3031/05/2023 13:30
2430619299SPECWO-5097730PCM31/05/2023 12:4901/06/2023 14:0001/06/2023 16:00
2530619313SPECWO-5098489CM01/06/2023 02:3001/06/2023 05:0001/06/2023 05:30
2630628882SPECWO-5098501CM01/06/2023 04:0401/06/2023 05:1501/06/2023 06:00
2730626985SPECWO-5098524CM01/06/2023 06:0101/06/2023 07:0001/06/2023 08:00
2830621730SPECWO-5098526CM01/06/2023 06:1201/06/2023 09:3001/06/2023 10:30
2930621730SPECWO-5098681PCM01/06/2023 11:4302/06/2023 14:0002/06/2023 14:30
3030631207SPECWO-5098731CM01/06/2023 13:0301/06/2023 14:3001/06/2023 15:30
3130619321SPECWO-5098785CM01/06/2023 14:3701/06/2023 16:3001/06/2023 17:00
3230628849SPECWO-5098848CM01/06/2023 16:2401/06/2023 16:3001/06/2023 17:30
3330628851SPECWO-5099668CM02/06/2023 03:1102/06/2023 05:0002/06/2023 08:00
3430619330SPECWO-5099683CM02/06/2023 04:5002/06/2023 05:3002/06/2023 05:55
3530628849SPECWO-5099682CM02/06/2023 04:5102/06/2023 05:3002/06/2023 06:00
3630619318SPECWO-5099689CM02/06/2023 05:4102/06/2023 05:5502/06/2023 11:00
3730626985SPECWO-5099690CM02/06/2023 05:5302/06/2023 08:0002/06/2023 09:00
3830626989SPECWO-5099803CM02/06/2023 08:3202/06/2023 10:0002/06/2023 10:30
3930628837SPECWO-5099811CM02/06/2023 08:4102/06/2023 10:0002/06/2023 11:00
4030631207TSOWO-5099859PCM02/06/2023 10:0805/06/2023 11:4805/06/2023 12:48
4130626989SPECWO-5099896CM02/06/2023 10:5802/06/2023 11:3002/06/2023 12:00
4230619318SPECWO-5099900CM02/06/2023 11:0306/06/2023 08:0006/06/2023 08:45
Sheet1
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi Johnstone200,

I do not see the second record (04/07/2023 07:44) that you mention in the supplied information. Could you update the information you provided?

Thanks,

Doug
 
Upvote 0
Ah, I see Doug. I have accidentally deleted that row to upload the data. In essence it is the difference between finish date of a PCM and the next reported date of a CM based on the condition that it is the same asset number. The following CM's after this will be not counted up until the next PCM to CM data. See asset 30628847 and 30626989 for an example. I am determining how long an asset is in service for after a PCM has taken place so the actual data I have covers thousands of work orders.
Hope that makes sense.
 
Upvote 0
I would be inclined to use a helper column.
You can combine it into a single formula if you want to.
You didn't say if you wanted the result in days or hours so I have left it in days.

20231007 Elapsed Time.xlsx
ABCDEFGHI
1assetnumpersongroupwonumworktypereportdateactstartactfinishNext Start DateElapsed Time (days)
230619361SPEC-DWO-4898986PCM24/12/2022 09:5128/12/2022 02:2728/12/2022 02:27Latest Date 
330627005SPECWO-4916354PCM07/01/2023 12:4408/01/2023 09:0008/01/2023 10:00Latest Date 
430619362SPECWO-4917206PCM08/01/2023 11:1008/01/2023 07:0008/01/2023 08:00Latest Date 
530618897SPECWO-4917231PCM08/01/2023 12:0008/01/2023 13:3008/01/2023 14:30Latest Date 
630619304SPECWO-4917235PCM08/01/2023 12:0218/01/2023 14:5818/01/2023 14:58Latest Date 
730619294SPECWO-4928321PCM17/01/2023 11:2318/02/2023 10:0018/02/2023 11:00Latest Date 
830627014SPECWO-4935937PCM23/01/2023 10:5423/01/2023 10:0023/01/2023 11:00Latest Date 
930619100SPECWO-4936041PCM23/01/2023 12:5325/01/2023 12:3025/01/2023 14:30Latest Date 
1030627017SPECWO-4983733PCM28/02/2023 23:2406/03/2023 08:0006/03/2023 09:00Latest Date 
1130628847SPECWO-5053149PCM26/04/2023 14:3330/04/2023 14:0002/06/2023 15:00Latest Date 
1230645547SPECWO-5056130PCM28/04/2023 12:0627/06/2023 04:3127/06/2023 04:31Latest Date 
1330626989SPECWO-5056157PCM28/04/2023 12:4829/04/2023 08:3029/04/2023 11:0002/06/2023 11:3034.0208333
1430619346SPECWO-5057447PCM29/04/2023 14:1503/05/2023 16:0003/05/2023 17:00Latest Date 
1530618898SPECWO-5067748PCM07/05/2023 03:1213/05/2023 12:0513/05/2023 12:05Latest Date 
1630628860SPECWO-5077466PCM15/05/2023 10:5417/05/2023 11:3017/05/2023 12:30Latest Date 
1730619072SPECWO-5085005PCM21/05/2023 11:4302/06/2023 14:3002/06/2023 16:00Latest Date 
1830618792SPECWO-5086122PCM22/05/2023 14:2223/05/2023 12:0023/05/2023 13:45Latest Date 
1930644583SPECWO-5086123PCM22/05/2023 14:2323/05/2023 12:0023/05/2023 15:00Latest Date 
2030619083SPECWO-5092924CM28/05/2023 06:2728/05/2023 07:0028/05/2023 08:00Latest Date 
2130626985SPECWO-5092933CM28/05/2023 06:4728/05/2023 10:0028/05/2023 10:3001/06/2023 07:003.85416667
2230626991SPEC-DWO-5095155PCM30/05/2023 11:2522/06/2023 02:5922/06/2023 02:59Latest Date 
2330619352SPECWO-5097659PCM31/05/2023 10:4731/05/2023 11:3031/05/2023 13:30Latest Date 
2430619299SPECWO-5097730PCM31/05/2023 12:4901/06/2023 14:0001/06/2023 16:00Latest Date 
2530619313SPECWO-5098489CM01/06/2023 02:3001/06/2023 05:0001/06/2023 05:30Latest Date 
2630628882SPECWO-5098501CM01/06/2023 04:0401/06/2023 05:1501/06/2023 06:00Latest Date 
2730626985SPECWO-5098524CM01/06/2023 06:0101/06/2023 07:0001/06/2023 08:0002/06/2023 08:001
2830621730SPECWO-5098526CM01/06/2023 06:1201/06/2023 09:3001/06/2023 10:3002/06/2023 14:001.14583333
2930621730SPECWO-5098681PCM01/06/2023 11:4302/06/2023 14:0002/06/2023 14:30Latest Date 
3030631207SPECWO-5098731CM01/06/2023 13:0301/06/2023 14:3001/06/2023 15:3005/06/2023 11:483.84583333
3130619321SPECWO-5098785CM01/06/2023 14:3701/06/2023 16:3001/06/2023 17:00Latest Date 
3230628849SPECWO-5098848CM01/06/2023 16:2401/06/2023 16:3001/06/2023 17:3002/06/2023 05:300.5
3330628851SPECWO-5099668CM02/06/2023 03:1102/06/2023 05:0002/06/2023 08:00Latest Date 
3430619330SPECWO-5099683CM02/06/2023 04:5002/06/2023 05:3002/06/2023 05:55Latest Date 
3530628849SPECWO-5099682CM02/06/2023 04:5102/06/2023 05:3002/06/2023 06:00Latest Date 
3630619318SPECWO-5099689CM02/06/2023 05:4102/06/2023 05:5502/06/2023 11:0006/06/2023 08:003.875
3730626985SPECWO-5099690CM02/06/2023 05:5302/06/2023 08:0002/06/2023 09:00Latest Date 
3830626989SPECWO-5099896CM02/06/2023 10:5802/06/2023 11:3002/06/2023 12:00Latest Date 
3930628837SPECWO-5099811CM02/06/2023 08:4102/06/2023 10:0002/06/2023 11:00Latest Date 
4030631207TSOWO-5099859PCM02/06/2023 10:0805/06/2023 11:4805/06/2023 12:48Latest Date 
4130626989SPECWO-5099896CM02/06/2023 10:5802/06/2023 11:3002/06/2023 12:00Latest Date 
4230619318SPECWO-5099900CM02/06/2023 11:0306/06/2023 08:0006/06/2023 08:45Latest Date 
Sheet1
Cell Formulas
RangeFormula
H2:H42H2=IFERROR(MIN(FILTER($F$2:$F$42,($A$2:$A$42=A2)*($F$2:$F$42>G2))),"Latest Date")
I2:I42I2=IF(ISNUMBER(H2),H2-G2,"")
 
Upvote 1
Solution

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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