# Distance Matrix

> Excel interface for the Distance Matrix API.

Page: https://docs.icepack.ai/excel/distance-matrix/

The Distance Matrix allows you to calculate road network distances between source and destination locations.


## Input Worksheet
To start with, create a sample template worksheet. You can then run the example or enter your own data.

**Worksheet name: DM-Locations**

The following fields must be entered for each location:
* ID: A unique ID.
* Longitude(x): The longitude of the location in decimal degrees.
* Latitude(y): The latitude of the location in decimal degrees.
* Source: A 1 to indicate if the the location should be considered as a source, 0 otherwise.
* Destination: A 1 to indicate if the location should be considered as a destination, 0 otherwise.


> **Note:**
> Note that a node can be both a source and destination. When computing all distance pairs, then all locations will be both a source and destination. If there are only source locations or only destination locations then no distances will be computed.





## Output Worksheets

The following information is returned from the Distance Matrix solver.


**Worksheet name: DM-Elements**

* From ID: The From Location ID.
* To ID: The To Location ID.
* Distance: The distance  between the locations as measured by the Distance units specified prior to submitting the data.
* Duration: The time taken to travel between the two locations as measured by the Time units specified prior to submitting the data.


> **Note:**
> As distances are computed from the road network, distances from A to B may differ from B to A.

