(For PC*Miler Web Services Spreadsheets)
=DistanceWS returns the distance between two points (origin to the destination). Distances are returned in miles by default, but can be changed to kilometers by setting the units to metric.
Syntax
=DistanceWS (origin, destination, routetype, dims, units, LCV, dataversion, traffic, hazmats, highwayonly, countries, region)
Examples
If you want to use some of the non-required arguments, but not all of them, include commas as placeholders for the arguments you are leaving out. For example, if you want the distance in kilometers for a practical route between Raunheim, Germany and Paris in PC*Miler 38, the syntax would be:
=DistanceWS("65479 Raunheim","75001 Paris",,,"metric",,"PCM38",,,,"fr, de","EU")
Arguments
Argument | Description | Required? | Values |
origin | The origin of the trip. | yes | A geocodable location in the PC*Miler database. Learn more about how to input locations. |
destination | The destination of the trip. | yes | A geocodable location in the PC*Miler database. Learn more about how to input locations. |
routetype | The PC*Miler route type to be used in mileage calculations. Learn more about PC*Miler route types. | no | Prac (Practical) Short (Shortest) Natl (State + National Network. U.S. Only) Toll (Toll Discouraged)* Air (Air Distance) or, a combination: Prac|Natl Short|Toll Practical is the Default. *Requires license for toll data. |
dims | The truck's dimensions. | no | Enter a number for each dimension in this order: height in inches, width in inches, trailer length in feet, weight in pounds, and number of axles. Each dimension must be separated by a comma. You can submit all dimensions or only some of them. If you want to skip a particular dimension, enter two commas with no space between them. Examples: 162,96,53,80000,8 162,,53,,8 |
units | The units of measurement used in the dims argument. Also sets whether distances are returned in miles or kilometers. | no | English (Default) Metric |
LCV | Indicates whether the truck is a multi-trailer or longer combination vehicle. Used for toll calculations in North America. | no | True False (Default) |
dataversion | The data version to be used in mileage calculations. (For users licensed for multiple data versions.) | no | Enter PCM plus the version number: The range is PCM18 to PCMXX (Current Version) Current version is default. Make sure the version is in quotes (e.g. "PCM38") to avoid an accidental cell reference in Excel. |
traffic | Indicates whether or not use traffic data. (For users licensed for traffic data.) | no | True False (Default) |
hazmats | A list of the hazmat categories that should be applied to the routes created for mileage calculations. | no | 0 = None (Default) 1 = General 2 = Caustic 3 = Explosives 4 = Flammable 5 = Inhalants 6 = Radioactive 7 = HarmfulToWater 8 = Tunnel (Separate by commas to pass more than one category in this argument.) |
highwayonly | (North America Only) Calculates routes using an air distance from the midpoint of the truck-usable highway segment that is nearest to the destination postal code or city/state. | no | True False (Default) |
countries | The country or countries where the origin and destination are located. | Not required but recommended for the most accurate geocoding and best performance. | A two-letter country code |
region | The region of the world where the origin and destination are located. | Not required but recommended for the most accurate geocoding and best performance. | Region Codes are NA (North America), EU (Europe), AS (Asia), AF (Africa), SA (South America), OC (Oceania), MX (Mexico), ME (Middle East), and WW (Worldwide). |