View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Stuart Bray Stuart Bray is offline
external usenet poster
 
Posts: 4
Default Miles Calculation?

On 29 Apr, 14:06, Ewing25 wrote:
Is there anyway to find the miles between the 2 places that are inputted into
2 different cells?

for instince if Los Angelas, CA is inputted into cell 1A and New York, NY is
inputted into cell 1B it will automatically put into cell 1C the miles
between them.

Is there anyway to do this?

Thanks


Get a list of coordinates of your locations. Eg http://www.infoplease.com/ipa/A0001796.html
Then look up the long and lat for each of your choices with a vlookup.
Then use pythagorus to work out the diagonal distance between them.
If cell D1 has the 'longtitude' difference (one minus the other), and
D2 has the 'latitude' difference, then the formula to put in C1 is:
=sqrt((D1*D1)+(D2*D2))

As to how to convert these figures to miles. Look online and find an
established distance. Then divide your number by this number to get
the constant ratio.