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!
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!