Creating a table with distance between airports

swymkyl

New Member
Joined
Oct 25, 2014
Messages
4
Hi,
I need to create a table giving me the distance between any two airports with the Airport codes listed in the header and the same codes listed in the left column
and using a formula with vlookup to get the longitude abd latitude from a table in another sheet. I want to copy that formula in the whole table using array formula to populate the table. To look like the attached photobelow
And the formula i used was
=ACOS(((SIN(VLOOKUP(A2,KK,4,TRUE)*3.14/180))*SIN((VLOOKUP(A3,KK,4,TRUE)*3.14/180))+(COS(VLOOKUP(A2,KK,4,TRUE)*3.14/180)*COS(VLOOKUP(A3,KK,4,TRUE)*3.14/180)*COS((VLOOKUP(A2,KK,8,TRUE)-VLOOKUP(A3,KK,8,TRUE))*3.14/180))))*180*60/3.14
Where cell A2 the first airport code
And cell A3 the second airport.
2EC1E1B6-0053-4F69-8B0D-0878B45301E6.png
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi Koen
Thanks for the reply but the $ sign Firs not D
work Because you are copying in two different
direction so it will work if i am copying the rows only and i have to change the $ every time i go yo the second row or column
But it will be very helpful if i can use an array formula.
 
Upvote 0
You don't need an array formula, the $ signs will work... If your purple cell is in A1, for the formula in B2:
=ACOS(((SIN(VLOOKUP($A2,KK,4,TRUE)*3.14/180))*SIN((VLOOKUP(B$1,KK,4,TRUE)*3.14/180))+(COS(VLOOKUP($A2,KK,4,TRUE)*3.14/180)*COS(VLOOKUP(B$1,KK,4,TRUE)*3.14/180)*COS((VLOOKUP($A2,KK,8,TRUE)-VLOOKUP(B$1,KK,8,TRUE))*3.14/180))))*180*60/3.14
And drag that to the right & down.
Good luck,
Koen
 
Upvote 0
Solution

Forum statistics

Threads
1,215,734
Messages
6,126,545
Members
449,317
Latest member
chingiloum

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