Waiting Room at a given time

mduntley

Board Regular
Joined
May 23, 2015
Messages
134
Office Version
  1. 365
Platform
  1. Windows
Hello. I am trying to figure this out. I work at a hospital, and I want to know at any given time, how many people are in the waiting room. I have got all the statistic that will be plug in. It will be more then one day. As I change the date and time, so will the number of people waiting. In this example. At 18:30, 4 people are waiting, but you can see 2 people after the first one came in and was helped . I was thinking of COUNTIF function, but I am not sure.


This space are patient name01/04/1514:4414:50date01/04/15
01/04/1514:4814:56time18:30
01/04/1515:3915:50how many people are waitng
01/04/1516:2519:34
01/04/1517:5117:59
01/04/1517:5718:06
01/04/1518:1818:43
01/04/1518:1918:43
01/04/1518:2118:52
01/04/1520:0220:13
01/04/1520:0920:30
01/04/1520:1820:21
01/04/1521:2121:27
01/04/1521:3721:38
01/04/1522:0222:09

<tbody>
</tbody>

Thanks for your help
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Welcome to the forum.

Assuming your data starts in A1, G1=Date, G2=Time

=COUNTIFS(C1:C15,"<"&G2,D1:D15,">"&G2,B1:B15,G1)
 
Upvote 0
Thank you so much, I was trying to figure it out, and i new the right one was COUNTIFS. Thank you so much
 
Upvote 0
Just want to ask if this is possible. I want to see if there is a formula that I can add that will only include a person who waited more then 30 minutes. In this example, Person 1 will show up in the section for 7:00 and 7:30 because he waited more then 30 minutes

Original formula
=COUNTIFS(C:C,"<"&H17,D:D,">"&H17,B:B,G5)

I tried to fix the formula to what I think would work, but it didn't

=COUNTIFS(C:C,"<"&H17,D:D,">"&(H17+TIME(0,30,)),B:B,G17)
accounttimewaitroomWeekDateTimehow many people
12/28/20140:520:53Week of 12/28 - 1/312/28/20140:000
12/28/20142:593:00Week of 12/28 - 1/312/28/20140:300
person 112/28/20146:167:34Week of 12/28 - 1/312/28/20141:000
person 212/28/20147:207:34Week of 12/28 - 1/312/28/20141:300
12/28/20148:078:18Week of 12/28 - 1/312/28/20142:000
12/28/20149:129:24Week of 12/28 - 1/312/28/20142:300
12/28/20149:269:36Week of 12/28 - 1/312/28/20143:000
12/28/20149:389:45Week of 12/28 - 1/312/28/20143:300
12/28/20149:4810:03Week of 12/28 - 1/312/28/20144:000
12/28/201410:2310:32Week of 12/28 - 1/312/28/20144:300
12/28/201411:0111:11Week of 12/28 - 1/312/28/20145:000
12/28/201411:5312:00Week of 12/28 - 1/312/28/20145:300
12/28/201412:0212:15Week of 12/28 - 1/312/28/20146:000
12/28/201412:4412:50Week of 12/28 - 1/312/28/20146:301
12/28/201413:0013:06Week of 12/28 - 1/312/28/20147:001
12/28/201414:1214:18Week of 12/28 - 1/312/28/20147:300
12/28/201414:2414:32Week of 12/28 - 1/312/28/20148:000

<tbody>
</tbody>
 
Upvote 0
I couldn't find a edit button. But I want to further explain what I'm looking for. In the original formula patient 1 will show in the category of 6:30, 7:00, and 7:30. I want to show him in the 7:00 and 7:30 because and not in 6:30 because he only waited 14 minute, thus he wouldn't be in the 6:30 section
 
Upvote 0
Test this one

=COUNTIFS($B$2:$B$1000,G2,$C$2:$C$1000,"<="&(H2-TIME(,30,)),$D$2:$D$1000,">="&H2)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,549
Messages
6,120,149
Members
448,948
Latest member
spamiki

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