# Airport to Airport Distance

#### ismailzkhan

##### Member
Dear Techies,

In a job I need to calculate Airport to Airport distance in Kms. I used to take help of https://www.travelmath.com/flying-distance to find this. As list is huge searching for each entry is taking so much time.

Airport codes are as per IATA

Attached excel file on this.

Regards,
Ismail Khan

#### Attachments

• Air Travel problem.xlsx
14 KB · Views: 74
There is no simple way
I can write a UDF tomorrow

You could do it in two stages.

1. Obtain Lat/Lon info for starting airport to destination airport.
This can be done manually and stored as list.
I'd just use data from Openflights personally. Use "airports.dat", it's in csv format.
https://openflights.org/data.html

Store it in separate sheet and lookup value (I'd recommend separating departure and arrival into 2 columns for ease of doing lookup).

2. Use Haversine formula UDF to calculate great-circle distances.
You can find the code in link below.

Ex:

Last edited:
Dear Chihiro,

Wow !!. This works like a charm. Thanks a lot.

Regards,
Ismail Khan

Or………………….

Use Haversine formula –
Finding distance between Airport locations in formula solution

1] In C8 (Distance in Km), enter formula :

2] See attached file together with Airport distance calculation sheet based on IATA code and Airport Database 2017

p.s.

If you want Distance in Mile, please change 6371(Km) to 3958.756(Mile) and formula become >>

Regards
Bosco

#### Attachments

• CalculateAirportDistance.xlsx
890.2 KB · Views: 194
Last edited:
Is the result of these calculations to be used in real world flight planning?

Probably not. Since OP was using link in initial post.

That site uses Vincenty algorithm & WGS84 ellipsoid model for Earth's shape.
This disregards any altitude info, much the same way as Haversine. Though Haversine uses perfect sphere.

Vincenty is more accurate, when compared to Haversine, but magnitude of difference is relatively small (sea level approximation difference/error margin of +/- 100m). Distance calculation result can differ between two methods by up to 0.5%.

Neither approach is appropriate for accurate flight path planning.

@ismailzkhan

Unless you are using UDF in code. I'd recommend going with Bosco's method (formula). It will be faster than UDF method I'd believe.

UDF was primarily written for use within code (such as tool for finding nearest endpoint for last mile fibre routing from list of geo-coordinates).

Hi Chihiro,

Noted. Thanks !!

View attachment 55889

Or………………….

Use Haversine formula –
Finding distance between Airport locations in formula solution

1] In C8 (Distance in Km), enter formula :

2] See attached file together with Airport distance calculation sheet based on IATA code and Airport Database 2017

p.s.

If you want Distance in Mile, please change 6371(Km) to 3958.756(Mile) and formula become >>