Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Miles Calculation?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Miles Calculation?

What distance do you want to measure? Driving distance? Great circle
distance? I have a workbook on my web site that lists the latitude and
longitude of about 1200 cities in the US and it has code and formulas for
calculating the great circle distance (shortest distance) between two
cities. See http://www.cpearson.com/Excel/latlong.htm for details and
download the workbook at http://www.cpearson.com/Zips/LATITU~1.ZIP .


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Ewing25" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Miles Calculation?

I have a worksheet named Miles. I also have a Userform that asks the user
for Start Location and End Location then what i want it to do is have it
query google maps for specific miles and import that finding into cell C2
then if they press New Location (Commandbutton1) it resets the form and puts
the new data in C3.

Any Idea how to do that?

"Chip Pearson" wrote:

What distance do you want to measure? Driving distance? Great circle
distance? I have a workbook on my web site that lists the latitude and
longitude of about 1200 cities in the US and it has code and formulas for
calculating the great circle distance (shortest distance) between two
cities. See http://www.cpearson.com/Excel/latlong.htm for details and
download the workbook at http://www.cpearson.com/Zips/LATITU~1.ZIP .


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Ewing25" wrote in message
...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format cell - Miles Dave Eade Excel Discussion (Misc queries) 5 June 30th 09 11:43 AM
Miles per gallon spreadsheet Greg[_5_] Excel Worksheet Functions 2 March 28th 09 07:04 PM
Averaging miles per gallon TckyTina Excel Worksheet Functions 3 April 29th 08 09:17 PM
Calculation: miles between two points using latitude & Longitude Candy Excel Discussion (Misc queries) 1 May 23rd 07 04:22 PM
Miles Per Hour WalkerDude999 Excel Worksheet Functions 1 May 7th 06 09:42 AM


All times are GMT +1. The time now is 02:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"