Ok Gurus, Can you help?
I have data from a machine. The data is On and Off times for different codes. See the attached workbook "Chando Example" and sheet "Alarms On and Off Query".
I need to find the duration in time between the On and Off timestamp for each individual Code. Codes can be repeated.
More out of desperation than knowledge, I hacked the following solution:
A query for the On times: "On"
A query for the Off times: "Off"
Merge the two on "code": "OnOffMerge"
Pivot Table to produce the min time difference by code, date, hour and minute: "PivotWithMin of time difference"
Surprisingly this works, the only exception being when the fault code is repeated within the hour and the Pivot picks the minimum of the two time differences; I really should have both. You can see the calculation to give minutes.
However, I just know that this can be done correctly, perhaps vba or with a more accurately designed combo of query, pivot, vba. I dunno, but the above was as far as I could take it after some serious effort on my part.
So please have a look and see if this can be done
Many thanks
Conor
Ireland
I have data from a machine. The data is On and Off times for different codes. See the attached workbook "Chando Example" and sheet "Alarms On and Off Query".
I need to find the duration in time between the On and Off timestamp for each individual Code. Codes can be repeated.
More out of desperation than knowledge, I hacked the following solution:
A query for the On times: "On"
A query for the Off times: "Off"
Merge the two on "code": "OnOffMerge"
Pivot Table to produce the min time difference by code, date, hour and minute: "PivotWithMin of time difference"
Surprisingly this works, the only exception being when the fault code is repeated within the hour and the Pivot picks the minimum of the two time differences; I really should have both. You can see the calculation to give minutes.
However, I just know that this can be done correctly, perhaps vba or with a more accurately designed combo of query, pivot, vba. I dunno, but the above was as far as I could take it after some serious effort on my part.
So please have a look and see if this can be done
Many thanks
Conor
Ireland