Skip to content Skip to main navigation Skip to footer

Average Rate per Distance for Different Distance Intervals

The average rate per distance can be one of the methods for calculating the final price for a ride. The guide below demonstrates how to calculate the average rate per kilometer (or mile) from given distance ranges and the prices assigned to them.

Example

Distance in Km – Price Per Km
0-10 km – $4.00
10-20 km – $1.75
20-999 km – $1.50

Important!

If you have already created any price rules, deactivate them (move to the trash) because they may overwrite the final effect.

Case: A customer requests a ride that covers a distance of 48 kilometers. To calculate the average rate per kilometer for this distance given the provided rates, we need to determine the total cost for the entire ride and then divide it by the total distance traveled.

Given the rates:
$4.00 per kilometer for the first 10 km
$1.75 per kilometer for the next 10 km
$1.50 per kilometer for any distance beyond 20 km

We can break down the calculation as follows:
For the first 10 km: $4.00/km * 10 km = $40
For the next 10 km (totaling 20 km): $1.75/km * 10 km = $17.50
For the remaining 28 km (48 km – 20 km): $1.50/km * 28 km = $42.00

Total cost:
$40 (for the first 10 km) + $17.50 (for the next 10 km) + $42.00 (for the remaining 28 km) = $99.50

Average rate per kilometer:
Total cost / Total distance = $99.50 / 48 km = $2.07/km

Good to Know

If the result of the Total cost / Total distance operation has more than 2 decimal places, it is rounded to the nearest hundredth. Thus, in the case of the above operation, the result of 2.07291(6) is rounded to 2.07.

Therefore, the price for a ride over a distance of 48 km is 48 * 2.07/km = $99.36

We need only 1 rule to achieve the intended result.

I will apply the rule to the BMW vehicle, as shown in the screenshots below.

Adding ‘Rule #1’

Step 1. Go to the ‘Pricing Rules’ menu and add a new pricing rule (Add New), I call it ‘Rule #1’.

Step 2. Go to the ‘Conditions’ -> ‘Vehicles’ tab and select the vehicle from the list (in my case “BMW 5 Series Long”).

See screenshot

Step 3. Go to the ‘Conditions’ -> ‘Distance’ tab and set the parameters as shown in the screenshot below:

See screenshot

Step 4. Go to the ‘Prices’ tab and set the ‘Price Source Type’ option to ‘Calculation based on distance (all ranges)’. In addition, you should set all price types to ‘- Inherited -‘, so that this rule has no impact (does not reset) the prices in your configuration. See the screenshot below:

See screenshot

Step 5. Save the rule by clicking ‘Publish’. The rule should look like this:

See screenshot

Final Result

Here’s the pricing effect for renting BMW 5 Series Long vehicle for a distance of 48 km:

See screenshot

We hope this guide has equipped you with the necessary knowledge to calculate the average rate per kilometer. Thank you for reading!

Summary

Document version: 1.0
Last updated: March 1, 2024
Plugin version: 6.8+

Was This Article Helpful?

Related Articles