Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I need help constructing a formula to determine the distance between 2 zip
codes (actually the demical Lat & Lon). The zip code information was downloaded from http://data.geocomm.com/editorspicks...ensuszips.html I found the formula on this site: http://www.dbazine.com/weeg9.shtml Column D: Decimal Longitude Column E: Decmimal Latitude Column F: DLON Column G: DLAT Column H: A Column I: C Column J: D My excel equivlent formulas a DLON = =ABS(D3-D2) DLAT = =ABS(E3-E2) A = SIN(G2/2)^2+COS(E2)*COS(E3)*SIN(F2/2)^2 C = 2*ASIN(MIN(1,SQRT(H2))) D = 0.017453293*I2 But result is not correct. Anybody know what I did wrong? TIA Mike |
#2
![]() |
|||
|
|||
![]()
http://www.cpearson.com/excel/latlong.htm
Forgot about the greatest excel help site on the web. Thanks Chip! "Squid" wrote: I need help constructing a formula to determine the distance between 2 zip codes (actually the demical Lat & Lon). The zip code information was downloaded from http://data.geocomm.com/editorspicks...ensuszips.html I found the formula on this site: http://www.dbazine.com/weeg9.shtml Column D: Decimal Longitude Column E: Decmimal Latitude Column F: DLON Column G: DLAT Column H: A Column I: C Column J: D My excel equivlent formulas a DLON = =ABS(D3-D2) DLAT = =ABS(E3-E2) A = SIN(G2/2)^2+COS(E2)*COS(E3)*SIN(F2/2)^2 C = 2*ASIN(MIN(1,SQRT(H2))) D = 0.017453293*I2 But result is not correct. Anybody know what I did wrong? TIA Mike |
#3
![]() |
|||
|
|||
![]()
On Wed, 9 Mar 2005 16:57:08 -0800, "Squid"
wrote: I need help constructing a formula to determine the distance between 2 zip codes (actually the demical Lat & Lon). The zip code information was downloaded from http://data.geocomm.com/editorspicks...ensuszips.html I found the formula on this site: http://www.dbazine.com/weeg9.shtml Column D: Decimal Longitude Column E: Decmimal Latitude Column F: DLON Column G: DLAT Column H: A Column I: C Column J: D My excel equivlent formulas a DLON = =ABS(D3-D2) DLAT = =ABS(E3-E2) A = SIN(G2/2)^2+COS(E2)*COS(E3)*SIN(F2/2)^2 C = 2*ASIN(MIN(1,SQRT(H2))) D = 0.017453293*I2 But result is not correct. Anybody know what I did wrong? TIA Mike Mike, Excel's trig functions expect the angles to be in radians; you are inputting them in degrees and not converting. So for each reference to a lat/long, encase it in a RADIANS argument. e.g. DLON = ABS(RADIANS(D3) - RADIANS (D2)) --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel doesn't sort zip codes properly | Excel Discussion (Misc queries) | |||
Printing zip codes that start with 0 | Excel Discussion (Misc queries) | |||
Set column to only allow certain codes??? | Excel Worksheet Functions | |||
I am not able to format cells for zip codes | Excel Worksheet Functions | |||
Time and distance formula | Excel Worksheet Functions |