HELP PLEASE Counting hours of the day for any given hour of the day

tbobolz

Board Regular
Joined
Mar 18, 2010
Messages
144
Hi All,

I am trying to calculate a count of the hours of the day patients are in our facility, So if a person is admitted at say: 04/01/2019 3:45:00 PM and discharged at 04/01/2019 5:30:00 PM, then that patient would be counted at the 3rd, 4th and 5th hour.
I have created a spreadsheet that does an okay job of this, which took many calculated columns, considering the patient could be here from 11pm to 2am, which is a different date.

Does anyone have any suggestions on how to create this data so I can still use a pivot table? Keeping in mind that if I’m looking at just my Sunday patients, it should not include those that stayed past midnight. It should include those after midnight in Monday’s count. Also it is possible that patients stay for many days and cross several different days of the week.

My current columns identifies them after midnight, but it places them on the same day and not the next day. I’m pretty experienced in Power Pivots and Power BI, if there’s any suggestions for those products?

Sorry, this is difficult to explain, so hopefully I did it well, I’m just at a loss at how to accomplish this, without manually manipulating the data.

Thanks
Terry
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,214,525
Messages
6,120,052
Members
448,940
Latest member
mdusw

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