Using Excel to calculate occupancy

Nad4

New Member
Joined
Mar 15, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I have a spreadsheet with arrival times and discharge times for thousands of patient attendances. Using the arrival time and discharge time I am looking to calculate the number of people in the department by hour so the patient numbers at 00, 01, 02 etc through to 23. For example if a patient arrived at 01:10 and was discharged at 05:20 they would be in the department at 01, 02, 03, 04, 05. Is there an easy way to calculate this for each of the 24 hours?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the forum. Would you be able to provide a sample (sanitized for privacy) set of data? It takes time for the forum to completely build your scenario.
The forum has a tool called xl2bb add in (link below) that allows you to easily copy and paste ranges from worksheets. If you cannot do that, then please post your data as a table (copy/paste). While images are helpful, it still means the forum needs to recreate entirely.

Thanks in advance.
 
Upvote 0
Here is a suggestion with some made up data:
Mr Excel Questions 75.xlsm
ABCDEFGHIJKL
1Check inCheck Out9:00 AM10:00 AM11:00 AM12:00 PM1:00 PM2:00 PM3:00 PM4:00 PM5:00 PM
209:0010:4350807859338000
309:0012:08
409:0311:34
509:0312:33
609:0311:20
709:0413:51
809:0411:19
909:0511:26
1009:0811:46
1109:0812:48
1209:1012:44
1309:1010:24
1409:1212:57
1509:1213:12
1609:1211:20
1709:1211:34
1809:1213:02
1909:1213:03
2009:1411:08
2109:1512:50
2209:1510:46
2309:1510:42
2409:1613:11
2509:1812:53
2609:2011:08
2709:2110:22
2809:2211:57
2909:2312:49
3009:2413:08
3109:2814:05
3209:3012:20
3309:3110:57
3409:3312:16
3509:3412:19
3609:3514:01
3709:3612:17
3809:3610:40
3909:3911:32
4009:4013:42
4109:4411:27
4209:5013:45
4309:5013:25
4409:5011:22
4509:5110:45
4609:5413:08
4709:5612:05
4809:5612:39
4909:5613:05
5009:5712:17
5109:5913:37
5210:0613:04
5310:0614:07
5410:1011:19
5510:1413:36
5610:1812:31
5710:1811:58
5810:2013:15
5910:2011:00
6010:2111:22
6110:2113:02
6210:2511:03
6310:2812:37
6410:2813:38
6510:3511:01
6610:3913:08
6710:4014:17
6810:4210:55
6910:4414:03
7010:4412:56
7110:4410:39
7210:4613:29
7310:4613:36
7410:4812:58
7510:4812:33
7610:5214:01
7710:5413:53
7810:5612:36
7910:5611:56
8010:5612:42
8110:5811:35
8211:0010:27
8311:0910:27
8411:1011:05
8511:2412:10
8611:3910:37
8711:4010:52
8811:4211:32
8911:4811:47
9011:5414:01
9111:5614:05
9211:5613:02
9311:5712:06
9412:1512:52
9512:2413:36
9612:2810:28
9712:3013:56
9812:4012:54
9912:4812:05
10013:3010:42
10113:5513:08
102
Sheet9
Cell Formulas
RangeFormula
D1:L1D1=TIME(SEQUENCE(1,9,9,1),0,0)
D2:L2D2=SUM((HOUR(D$1)>=HOUR($A2:$A101))*(HOUR(D$1)<=HOUR($B2:$B101)))
Dynamic array formulas.
 
Upvote 0
Thank you for this, I will try this and let you know. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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