Given an array with start and stop date and time, proportionally allocate hours of run to a particular date and display total hours for that date

himani25gupta

New Member
Joined
Mar 6, 2016
Messages
1
Hi,

I am working on a problem in which I have an array of start and stop dates (mm/dd/yyyy) and time (24 hour format) and a total cost, for example:
Start date Stop Stop Total Cost
Row1 3/4/2016 14:00 3/6/2016 08:00 4200
Row2 3/6/2016 16:00 3/6/2016 18:00 200

I want to proportionally allocate the cost to the date based on time used up on that date and then add up and display total cost from multiple columns for that date. In the example above, in Row1 we have total of 42 hours, for date 3/6/2016 we have 8 hours of run, therefore proportionate cost for 3/6/2016 will be 8/42*42000 = 800 and from Row2 since it only has 3/6/2016, cost for 3/6/2016 will be 200. Therefore total for 3/6/2016 will be 800+200 = 1000. I have a separate column of 365 days where I need to display 1000 in front of 3/6/2016. Please let me know if somebody can help me with finding an elegant solution for this. Thanks!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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