CDXDistance2WP Function
Previous  Top  Next


For a general overview of how to insert data and functions into your worksheet, please refer to the topic Inserting Data and Functions.

CDXDistance2WP is a right-click function available in the MapPoint, Basic, Premium, and Premium ACS versions of CDXZipStreamTM. It calculates the straight-line ("as the crow flies") distance between two locations as defined by their latitude and longitude coordinates. CDXDistance2WP can be employed as a right-click function or input directly into your worksheet as a custom function formula. (Please also refer to the help section on custom functions.)

To use as a right-click function, right-click on any cell in a worksheet, select the Insert CDXDistance2WP Function, and you will see the input box shown below:

clip0381

The latitude and longitude coordinates of both waypoints are required. ("Waypoint" is a navigational term for a location defined by latitude and longitude coordinates. It has come into common use with the development of Global Positioning Systems.) Latitude and longitude must be in decimal format and NOT as "degrees-minutes-seconds". You must also specify whether the distance between the two waypoints will be returned to the worksheet in miles, kilometers, or nautical miles.

The input boxes may contain the actual latitude and longitude values like in the example above, or you may specify the worksheet cell location of the values (such as A1 or $A$1).

In cases where you wish to apply the CDXDistance2WP function to a list of waypoints, input the custom function formula as shown below:

clip0382



The CDXDistance2WP function is input as a custom function formula in the following generalized form:

   =CDXDistance2WP(Waypoint1 Latitude, Waypoint1 Longitude, Waypoint2 Latitude, Waypoint2 Longitude, Distance Unit)

The distance unit can be "M" for miles, "KM" for kilometers, or "NM" for nautical miles. If the distance unit is not specified, the default value is miles.

For this example, the distance between the first pair of waypoints is 307.44 miles:

clip0384

To apply this function to the rest of the data, copy and paste the custom function formula. In this case, we copy cell E4 and paste it to the range E5 through E13:

clip0385


This cut and paste technique will also work if the waypoint locations are listed in rows instead of columns as shown here.