malsatori
malsatori

Reputation: 39

Find total at given time based on check in and check out times Google Sheets

I am trying to make a google sheet based off of attendance check-in and check-out times at the facility I work at to show how many individuals are in the building at different points during the day.

In one column I have check-in time, in another column I have check-out time and in a third column I have the different timestamps where I want to know the total attendance at that timestamp.

The best I've been able to come up with is =arrayformula(COUNTIF(A2:A,EQ(D2,MEDIAN(A$2:A,B$2:B,D2)))) but it's not returning any values. I've included an example sheet that shows what information I have available.

Google Sheets example: https://docs.google.com/spreadsheets/d/1fFoGGBw4yZnhodbZJFsTiODlUsybwxBEK74v1G22xV4/edit?usp=sharing

Upvotes: 0

Views: 121

Answers (1)

Tom Sharpe
Tom Sharpe

Reputation: 34180

Try using countifs:

=ArrayFormula(if(D2:D<>"",countifs(A2:A,"<="&D2:D,B2:B,">="&D2:D),))

enter image description here

Upvotes: 1

Related Questions