# Excel | Advanced lookup functions exercise | Flights - MATCH and INDEX functions

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

 Software ==> Excel  (151 exercises) Version ==> Excel 2016 and later Topic ==> Advanced lookup functions  (9 exercises) Level ==> Average difficulty Subject ==> Excel training
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Open the file contained within the folder name shown above.

We want to look up flight times from the flights timetable:

This time we will use the =INDEX lookup formula with a nested =MATCH.

When we select the departure airport in cell K3 and the travel day in cell K4, we want Excel to look up and display the correct flight time in cell K9:

Time for some range names first!

Set up the following range names:

Range name Cell(s)
Airport K3
Flight_Day K4
Airport_Pos_Num K6
Timetable B4:H19
Week_days B3:H3

In cell K9 start off with an =INDEX formula that finds the flight time for a flight from Dover (position number 8) on a Wednesday (position number 3).  So the formula would be:

=INDEX(timetable,8,3)

We can now use an =MATCH in cells K6 and K7 to find the position numbers for the airport and day of the week. Change the airport to Leeds and the day to Fri:

Use your range names in the =MATCH formulae in cells K6 and K7.

Now change your =INDEX formula in cell K9 to refer to the =MATCH formulae in cells K6 and K7

Check this new formula works by changing the airport to Birmingham and the flight day to Sun:

Almost finished!

Now it is time to put everything together in one formula in merged cell K11:

Change the airport and flight day to check that your new nested formula is working.

Use Save As... to save the file in your own new Excel work folder.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.