PC*MILER Spreadsheets includes a number of functions that allow you to retrieve location information from the PC*MILER database.
Getting a Latitude/Longitude from a Location
=CityToLatLong (CityStateOrZipcode)
CityToLatLong takes a PC*MILER location (city-state, postal code, SPLC, truck stop, PC*MILER custom name) and returns the latitude/longitude of a point central to the location in degrees, minutes, seconds format (dddmmssN,dddmmssW). CityToLatLong returns -1 if the PC*MILER place name you entered is invalid.
Getting a Place Name from a Latitude/Longitude
=LatLongToCity (LatLong)
LatLongToCity takes a latitude/longitude (degrees, minutes, seconds or decimal degrees format) and returns the miles from the PC*MILER place name at the closest end of the closest road segment. This may be either a city-state or a road intersection.
This function connects latitude/longitudes to the highway network as if you were routing to or from the latitude/longitude. LatLongToCity returns a -1 if the lat/long format is invalid or is more than 200 miles from a road in the PC*MILER highway network.
The CityToLatLong and LatLongToCity functions may be, but are not necessarily, reversible because not all PC*MILER place names are located at the end points of road segments.
Getting a Latitude/Longitude from an Address
=AddressToLatLong (Address)
(In North America with the Streets add-on only) AddressToLatLong takes a street address and returns the latitude/longitude in degrees, minutes, seconds format (dddmmssN,dddmmssW). AddressToLatLong returns -1 if the place name you entered is invalid.
The function may be, but is not necessarily reversible. For a decimal format return, see the PCMSERVE.INI.
Getting an Address from a Latitude/Longitude
=LatLongToAddress (LatLong)
(In North America with with the Streets add-on only) LatLongToAddress takes a latitude/longitude (degrees, minutes, seconds or decimal degrees format) and returns the address. This function connects latitude/longitudes to the highway network as if you were routing to or from the latitude/longitude.
LatLongToAddress returns a -1 if the lat/long format is invalid or is more than 200 miles from a road in the streets highway network. The function may be, but is not necessarily reversible.
For roads that have both a street name and a route number, the route number will be returned in parentheses after the street name. For example:
=latlongtoaddress(addresstolatlong("Princeton, NJ; 245 Nassau Street")) returns
08540 Princeton, NJ, Mercer; 245 Nassau Street (NJ-27).