Find total at given time based on check in and check out times Google Sheets - 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

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

Related

How to create a linked sheet that checks a box for a day if found and inserts text from another column

I'm trying to create a sheet in google sheets for my team that shows me what runners have run on what day of the week. Their activities are automatically imported via Zapier with dates from Strava into another worksheet. I would like to have it where when they run and it imports the activity into the sheet, in the other worksheet, it checks off the day of the week for that runner. Ideally, it would reset weekly. Pictures are attached. Thanks!
Also, it would be helpful to have it where it shows the total number of miles per runner in a week, and miles per runner per week (like in this picture)

How to limit teams view to just their own assignments

I have a google sheet work order page set up. The columns are:
ID No., Title, Description, Location, Crew Assigned, Date Assigned, Hours Worked, Work Description.
Crew Assigned are pulled from a dropdown populated by a second sheet. So the entry is standardized.
I want the crew, when they open up the work order sheet, to see only the rows that are assigned to them. They would then enter Hours Worked, and the Work Description. They use apple mobile devices exclusively.
Is there a best practice for this type of work delegation within sheets?
The best way to do this is to have one master spreadsheet and then to each team give a new spreadsheet with FILTER(IMPORTRANGE(... formula.

Publishing sheets results in all errors

I have a roster style spreadsheet from which I want to publish a few pages. I can publish most of the pages fine, but I'm having trouble with displaying the values in a few.
I've created a sheet that takes today's date and populates with the values from another sheet with today's date in its title. That way when I publish this particular sheet it will change every week, without the need to re-publish a different sheet every Monday.
The thing is, when I do publish these individual sheets every week there's no issue; but when I try and publish this automatically updating one every cell with values just contains #VALUE!, with a couple of #REF! errors.
This doesn't make sense to me, as they contain the same values. The only difference is that one has values that populate from other sheets (but even the ones that are working have some cells that update from other sheets, and they work fine!)
EDIT: When using ImportRange() to try and port the data to another sheet a few cells display: the ones only locally referencing this particular sheet, and not calling information from elsewhere.

Monitoring a google sheet for changes and validating data

Problem: Write a program that creates a spreadsheet and constantly monitors it for changes. Any row that contains "invalid data" (according to a rule defined by a regex) in one of the columns should be deleted. For example, lets say that column A must be a valid date, while all the other columns can hold arbitrary data. Then, if someone enters an invalid date into cell A5, all the data in row 5 should be removed.
Attempted solution:
The program will have to deal with a lot of data, so when i am monitoring the sheet, i would like to obtain changes made to the spreadsheet as just the change. That is, i dont want to have to request the entire spreadsheet of data every time an edit is made. The only way that i have found to obtain only edits is through google apps script, but i have not found a way to create a spreadsheet along with an apps script bound to it. Is this possible through google apis, or is there a better way to tackle this problem?
I also looked into data validations as a possible solution, but I cannot find a setting that deletes an entire row when one specific column is invalid.

Google Sheets: Keeping static data aligned with data returned from a query as new data is added on top

first time poster but I've been able to solve a lot of problems with through the brilliant answers this community provides to users. So, firstly, thanks!
I'm making a Job Request tracking spreadsheet as well as using a Google Form to get the input data.
Jobs fall under categories of Building, IT, Keys, Maintenance and OHS as asked in the first question of the Google Form.
Depending on which category is selected, the user will go to a different section of a form with different questions.
That's all working great.
The data for all responses is saved in the same form response sheet and then using the Query function I have 5 sheets set up, one for each category, and I'm reading the relevant data into each sheet. The data is sorted based on date and time so that the most recent entry is at the top of the sheet.
To the right of each data set on each individual sheet I want to track whether the job is Completed, Pending, Not Approved. I want to track who gave it approval, and so on.
The problem is that when new data comes into the sheet it moves to the top as it is the most recent data. But the Completed, Pending, Not Approved, and other notes will not move down the sheet with the older data.
Help would be greatly appreciated.
Thanks!

Resources