Forum Discussion
Create a excel which changes dynamically with two variables described below.
I have data with me as elaborated below. And I want to calculate no. of passengers in the system at a particular time slot.
Departure Time | No. of passengers | 10% | 10% | 10% | 10% | 15% | 15% | 15% | 15% |
01:50 | 255 | 26 | 26 | 26 | 26 | 38 | 38 | 38 | 38 |
02:45 | 180 | 18 | 18 | 18 | 18 | 27 | 27 | 27 | 27 |
03:05 | 180 | 18 | 18 | 18 | 18 | 27 | 27 | 27 | 27 |
03:30 | 125 | 13 | 13 | 13 | 13 | 19 | 19 | 19 | 19 |
03:30 | 180 | 18 | 18 | 18 | 18 | 27 | 27 | 27 | 27 |
04:00 | 180 | 18 | 18 | 18 | 18 | 27 | 27 | 27 | 27 |
Total 8 slots | HH:MM-02:00 hours | HH:MM-01:50 | HH:MM-00:40 minutes | ||||||
10 min slot | 10 min slot | 10 min slot | 10 min slot | 10 min slot | 10 min slot | 10 min slot | 10 min slot |
So in the time frame of HH:MM-02:00 and HH:MM-00:40 all the passenger related to one flight will be there in the system. Same is the case for the remaining flights. Now what I want to calculate is, depend upon the flight departure time and no. of passengers, how many passengers will be there in the system at a particular time, let’s say at 03:00 and the calculations must change dynamically with the change in the departure time and no. of passenger.
Initially I thought that I will create 8 time slot for every flight depend upon HH:MM like if the flight time is 01:50 then time slots are 11:50, 12:00, 12:10, 12:20, 12:30, 12:40, 12:50, 01:00, 01:10 and assign the no. of passengers to that time slots like 26,26,26,26,38,38,38,38 and then I will group them using return multiple values through lookup and finally add the all passenger from all flights under one time slot of 10 minutes but I fail to do that because I am new to excel? Is there any other way to do this? Thank in advance for your support
Hi Shivraj,
please see attached for my solution. I have created two tables. The first one contains timeslots, and the second one - the number of passengers in each timeslot. Then, I used SUMPRODUCT formula to summarise the number of passengers in the system up to the specified time, excluding those, whose flights have departed. If the departure times are in the range B12:B17, timeslots in D12:K17, the number of passengers in each timeslot in the range D21:K26, and the time entry range in the cell C29, then the formula to summarise the number of passengers in the system would be
=SUMPRODUCT($D$21:$K$26*($D$12:$K$17<=$C$29)*($B$12:$B$17>$C$29))
Yury
- Yury TokarevSteel Contributor
Hi Shivraj,
please see attached for my solution. I have created two tables. The first one contains timeslots, and the second one - the number of passengers in each timeslot. Then, I used SUMPRODUCT formula to summarise the number of passengers in the system up to the specified time, excluding those, whose flights have departed. If the departure times are in the range B12:B17, timeslots in D12:K17, the number of passengers in each timeslot in the range D21:K26, and the time entry range in the cell C29, then the formula to summarise the number of passengers in the system would be
=SUMPRODUCT($D$21:$K$26*($D$12:$K$17<=$C$29)*($B$12:$B$17>$C$29))
Yury
- shivraj mohiteCopper Contributorthank you Yury, You are awesome...
- shivraj mohiteCopper Contributor
Thank you for your first reply, I have one more question, how to display the no. of passengers in all 10 minute slots, eg. 13:50to 14:00, 14:00 to 14:10?
- Yury TokarevSteel Contributor
Hi Shivraj,
you can create a list of timeslots in one column (each of them showing the end of the respective 10 minutes interval), then use the same formula in the next column with a difference that in each row it would refer to the respective timeslot end time in the same row (as shown in the image below). Please find the ammended file attached.
Thanks
Yury