I am monitoring service outages using excel 2007. I have a start and and end time as shown in the example below. Start and end time are in dd/mm/yyyy hh:mm:ss format.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Start[/TD]
[TD]End[/TD]
[TD]Days[/TD]
[TD]Hours[/TD]
[/TR]
[TR]
[TD]03/01/2018 18:30:00[/TD]
[TD]04/01/2018 02:42:00[/TD]
[TD]0.342[/TD]
[TD]8.20[/TD]
[/TR]
</tbody>[/TABLE]
Days is worked out using the following formula =IF(H31>G31,H31-G31, 1-G31+H31)
Hours worked out using the following formula =M31*24
Whilst the above provides the total outage duration is it possible to split the outage duration into segments / time ranges using a formula/formulas or some code? So for the example above the result would be as below. The formula/ code must take into account that an outage could span different days.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Hours Impacted Range[/TD]
[TD]Total Hours[/TD]
[/TR]
[TR]
[TD]06:00 - 11:59[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12:00 - 14:59[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]15:00 - 17:59[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]18:00 - 22:59[/TD]
[TD]4.5[/TD]
[/TR]
[TR]
[TD]23:00 - 05:59[/TD]
[TD]3.7
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Start[/TD]
[TD]End[/TD]
[TD]Days[/TD]
[TD]Hours[/TD]
[/TR]
[TR]
[TD]03/01/2018 18:30:00[/TD]
[TD]04/01/2018 02:42:00[/TD]
[TD]0.342[/TD]
[TD]8.20[/TD]
[/TR]
</tbody>[/TABLE]
Days is worked out using the following formula =IF(H31>G31,H31-G31, 1-G31+H31)
Hours worked out using the following formula =M31*24
Whilst the above provides the total outage duration is it possible to split the outage duration into segments / time ranges using a formula/formulas or some code? So for the example above the result would be as below. The formula/ code must take into account that an outage could span different days.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Hours Impacted Range[/TD]
[TD]Total Hours[/TD]
[/TR]
[TR]
[TD]06:00 - 11:59[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12:00 - 14:59[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]15:00 - 17:59[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]18:00 - 22:59[/TD]
[TD]4.5[/TD]
[/TR]
[TR]
[TD]23:00 - 05:59[/TD]
[TD]3.7
[/TD]
[/TR]
</tbody>[/TABLE]