In a formula-type column, the DISTANCE() function displays the straight-line distance (as the crow flies, not a driving route), in meters, between two points. Ideal for routing, logistics, field operations, or mileage calculations.
-
Function name:
DISTANCE()
Syntax
DISTANCE(Coordinate A, Coordinate B)
Prerequisites
- Two columns of type Coordinate (for example Coordinate A and Coordinate B). You can select points on the map (long press to move them).
- One column of type Formula (for example Distance (m)).
Steps
- Add a column → Formula → name it Distance (m).
- Enter the formula:
DISTANCE(Coordinate A, Coordinate B)
DISTANCE() returns a value in meters (as the crow flies).
- Column options: Output Number, Decimals 0, Symbol m.
- Validate: the cell displays the distance in meters between the two coordinates.
Kilometer option
For a result in kilometers, divide by 1000:
DISTANCE(Coordinate A, Coordinate B) / 1000
DISTANCE() then returns a value in km (as the crow flies). Column options: Output Number, Decimals 0, Symbol km.
Return type
The function returns a number (the distance in meters, or in kilometers when divided by 1000).
The output type format of the result can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula Column article.
Business use cases
DISTANCE() measures straight-line distance: proximity of a client to an agency, sorting interventions by distance, base for mileage allowance calculations.
Best practice
Obtain coordinates with GEOLOC() (from an address) or COORDINATES() (from X/Y values). The distance is as the crow flies, not driving distance.