Schedule lookup

Kariba

Board Regular
Joined
Mar 15, 2023
Messages
59
Office Version
  1. 365
Platform
  1. Windows
I have been given a schedule below and need to link arrival times to next departure time. ie 10:05 arrival linking to next 11:15 departure or 17:40 linking to next 18:55.

This is filtered on one example - number 54 which is the only common thread between them but linked rows could be hundreds of rows apart as it's in time order. I need to be able to reliably move up column B until it finds a match and then return the value in column G. Tried a few ways but not getting required result.

Any suggestions appreciated.

Book1
ABCDEFG
1Aircraft TypeAircraft IdentifierFlightDeparture AirportDeparture TimeArrival AirportArrival Time
2737544522ATL04:35:00MCO07:00
3737544523MCO07:35:00ATL10:05
4737544578ATL11:15:00TPA14:10
5737544579TPA14:45:00ATL17:40
6737545000ATL18:55:00TPA20:35
Sheet1
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
There is some confusion for me about your data. It seems that your Departure Times are times only (decimal number)
1693915734972.png


.. but your Arrival Times are a date and a time ( whole number + decimal) but formatted to show the time portion only
1693915766897.png


Can you confirm that is the case with your real data, or else please clarify what the actual situation is?

Also are you
- given an arrival time and want to look up the next departure time, or
- given a departure time and want to look up the previous arrival time?
 
Upvote 0
Sometimes it comes with date and time, but just need time format for all of it. For each departure, I need to find a previous arrival time for each aircraft
 
Upvote 0
Is this what you are looking for then?

23 09 05.xlsm
ABCDEFGHIJK
1Aircraft TypeAircraft IdentifierFlightDeparture AirportDeparture TimeArrival AirportArrival TimeIdentifierArrivalDeparture
2737544522ATL04:35:00MCO07:005410:0511:15:00
3737544523MCO07:35:00ATL10:055417:4018:55:00
448
522
6737544578ATL11:15:00TPA14:10
777
8737544579TPA14:45:00ATL17:40
91
102
113
12737545000ATL18:55:00TPA20:35
13
14
Arrival Departure
Cell Formulas
RangeFormula
J2:J3J2=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Identifier]=I2)*(AT<K2),"")))
 
Upvote 0
Certainly looks like it'll work. I'll paste into main table to test and will let you know
 
Upvote 0
Unfortunately not working when I moved it over. Not sure why as I can see anything different.
 
Upvote 0
Unfortunately not working when I moved it over.
What does "not working" mean (error? wrong result? crash Excel? something else?)

Did you adjust the table name &/or table column headings to match?

What about you post a small sample with XL2BB (any sensitive data removed or disguised) so that we can see your actual data/layout and the formula "not working"?
 
Upvote 0
Error messages. I had changed the headings etc to match. I've made further changes now though. Highlighted below examples of the data I'm trying to match together. Thanks.

Crew Catering Schedule issued - 04 Sep 2023.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1Flight DateLoading AirportAircraft Type CodeAircraft Registration IdentifierFlight NumberDeparture AirportDeparture TimeArrival AirportArrival TimeRouteIDFirst Departure AirportPassengers BookedCarrier CodeIdentifierArrival
207/09/20231807/09/2023 05:4507:40:0018=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G2),"")))
307/09/20232007/09/2023 06:0007:30:0020=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G3),"")))
407/09/20231307/09/2023 08:0009:10:0013=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G4),"")))
507/09/20231807/09/2023 08:1010:00:0018=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G5),"")))
607/09/20232007/09/2023 08:2510:45:0020=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G6),"")))
707/09/20231307/09/2023 09:4011:25:0013=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G7),"")))
807/09/20231807/09/2023 10:5013:50:0018=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G8),"")))
907/09/20232007/09/2023 11:2013:55:0020=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G9),"")))
1007/09/20231307/09/2023 11:5513:35:0013=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G10),"")))
1107/09/20231307/09/2023 14:2015:40:0013=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G11),"")))
1207/09/20231807/09/2023 14:2017:15:0018=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G12),"")))
1307/09/20231307/09/2023 16:1017:25:0013=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G13),"")))
1407/09/20232007/09/2023 16:1519:05:0020=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G14),"")))
1507/09/20231307/09/2023 17:5519:25:0013=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G15),"")))
1607/09/20231807/09/2023 18:0019:40:0018=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G16),"")))
1707/09/20232007/09/2023 19:3522:15:0020=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G17),"")))
1807/09/20231307/09/2023 19:5521:15:0013=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G18),"")))
1907/09/20231807/09/2023 20:1021:45:0018=LET(AT,MOD(Table1[Arrival Time],1),MAX(FILTER(AT,(Table1[Aircraft Registration Identifier]=V3)*(AT<G19),"")))
Catering Schedule
Cell Formulas
RangeFormula
V2:V19V2=D2
 
Upvote 0
Error messages.
Thanks. What error messages?

I've made further changes now though.
You certainly have.
  1. This sample data is not in a formal Excel table as the earlier sample data appeared to be. Is it in a formal table or not?
    If it is a formal table
    • What is the table name?
    • What columns are actually included in the table?
  2. Previously, the Departure Time underlying cell value was a time only. Now it is a date and time, like the Arrival Time column. Can you confirm that both Arrival Time and Departure Time columns contain date and time & it is just the formatting that makes them display differently to each other?

  3. Can you confirm that for that latest sample data, you would not be expecting any result for the first row since there is no Arrival Time before that first Departure Time of 05:45 on 07/09/2023 for Identifier 18? If you are expecting a result other than "", what result would it be and why?
 
Upvote 0
It's not in a formal table when it is received. We do some editing/formatting once we get it.
Arrival and departure contains both date and time although date is not normally relevant for us
There would be no result expected on first row and can remain blank.

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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