# Count overlapping times on a moving 30 min window

#### kbrono

##### New Member
I searched the forums for a similar question and did not see one that helped with this question.

I need to know on average how many airplanes are on the ground at the same time during the day.

To get an accurate number it needs to look 30 minutes ahead of and behind the departure time and then count how many other departure times fall in that window. Here is a sample set for two different days.

 Day Equip Dept Time Total Departure Dept Hour Staffing 1-Sep-16 CM9 6:43 1 6 4 1-Sep-16 CM9 7:00 1 7 4 1-Sep-16 CM9 7:45 1 7 4 1-Sep-16 CM9 8:05 2 8 8 1-Sep-16 CM9 8:10 1 8 4

<colgroup span="3" width="137"></colgroup> <colgroup width="154"></colgroup> <colgroup span="2" width="137"></colgroup> <tbody>
</tbody>

<colgroup span="3" width="137"></colgroup> <colgroup width="154"></colgroup> <colgroup span="2" width="137"></colgroup> <tbody>
</tbody>
 2-Sep-16 CPJ 8:45 1 8 3 2-Sep-16 CPJ 9:15 1 9 3 2-Sep-16 CPJ 10:20 1 10 3 2-Sep-16 CPJ 10:30 1 10 3 2-Sep-16 CPJ 12:46 1 12 3

<colgroup span="3" width="137"></colgroup> <colgroup width="154"></colgroup> <colgroup span="2" width="137"></colgroup> <tbody>
</tbody>

So for the first item I should get a value of 2 because nothing exists before 6:43 and there is only one other departure by 7:13 (30 min after 6:43). Now for example sake look at the fourth line. This should return a value of 4 because there is one departure within :30 min prior of 8:05 and one within :30 after 8:05 (there are two departures at 8:05).

So when then first aircraft is on the ground there is a total of two but when the 4th is on the ground there is a total of 3.

I then would need it to reset for the next calendar day. I will then take the average for every day for the entire month to say "at any given time there are xx aircraft on the ground at the same time"

The data set i have is a few thousand large.

Thanks,

1,082,316
Messages
5,364,494
Members
400,802
Latest member
RichBRich

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...