Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
I do have a string in a cell that looks like this (this is UTM ED50 format): 46° 34' 21.09" N 8° 24' 54.28" E I need to convert this string to Latitude and Longitude. The calculation method is pretty simple. In the example above, its 46 + 34/60 + 21.09/3600 = 46.572525 (Lattitude) 8 + 24/60 + 54.28/3600 = 8.415077778 (Longitude) So, the calculation as such is not very complicated. What drives me nuts is to get the numbers out of the long ED50 string. I managed this with a LOT of SEARCH() and MID() functions, but it's just awfull !!. Latitude =MID($K2,1,SEARCH("°",$K2)-1)+(MID($K2,SEARCH("°",$K2)+1,(SEARCH("'",$K2)-SE ARCH("°",$K2))-1))/60+(MID($K2,SEARCH("'",$K2)+1,(SEARCH("""",$K2)-SEARCH("' ",$K2))-1)/3600) Longitude =MID(MID($K2,22,15),1,SEARCH("°",MID($K2,22,15),1)-1)+MID(MID($K2,22,15),SEA RCH("°",MID($K2,22,15),1)+1,SEARCH("'",MID($K2,22, 15),1)-SEARCH("°",MID($K2, 22,15),1)-1)/60+MID(MID($K2,22,15),SEARCH("'",MID($K2,22,15),1) +1,SEARCH(""" ",MID($K2,22,15),1)-SEARCH("'",MID($K2,22,15),1)-1)/3600 Anyone knows a simpler way? Thanks Dan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Coordinates | Excel Worksheet Functions | |||
Converting Lat/Lon coordinates to Decimal | Excel Discussion (Misc queries) | |||
How do I convert Easting/ Northing GPS coordinates into Lat/Long? | Excel Discussion (Misc queries) | |||
convert x/y coordinates to a shape file to use in Cad? | Excel Discussion (Misc queries) | |||
Converting MouseDown Coordinates to Chart Point Coordinates | Excel Programming |