Summate times (hours) over a range without double counting

Bhrudwo

New Member
Joined
Jan 17, 2023
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I need to summate the hours that jobs went for, per year, so that I can produce a graph (and table) of the Number of hours affected per year affected by jobs.

As you will see in the data, there was a job that started on the 5th Dec and went to 16th Dec. There were other jobs that started and ended during this job, and I need to not double count these hours.

As another complex example: in addition to the data below, if a job started 16th Dec 07:00 and went to 16th Dec 15:00, the last two hours of it would need to be counted. But as there is a job starting 16th Dec 13:50, only 50 minutes of the job would really need to be counted.

Data looks like:
1674018156546.png

Original data is columns B and C, (column A is a unique identifier and sensitive information).
Column D is me calculating the month of the start time
Column E is me calculating the year of the start time
Column F is the round up to an integer of C - B
Column G is the hours between C and B, formatted to [h] so that I can so more than 24 hours.

I effectively need an output like
2018 xxxx hrs (summation for the year) 8760 (hours in the year) YYYY% (percentage of the year affected)
2019 xxxx hrs (summation for the year) 8760 (hours in the year) YYYY% (percentage of the year affected)
2020 xxxx hrs (summation for the year) 8784 (hours in the year) YYYY% (percentage of the year affected)
2021 xxxx hrs (summation for the year) 8760 (hours in the year) YYYY% (percentage of the year affected)
2022 xxxx hrs (summation for the year) 8760 (hours in the year) YYYY% (percentage of the year affected)
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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