Cost Per Mile Calculator in Excel: Formula, Template & How-To Guide

Cost Per Mile Calculator in Excel: How to Calculate, Track, and Reduce Your Transport Costs

If you run a delivery route, manage a fleet, or operate any vehicle-based business, your cost per mile is the single most important number in your operation. It determines whether the routes you're running are profitable, whether your pricing will sustain the business, and where you're leaking money without knowing it.

Most delivery business owners either don't track cost per mile at all — they track fuel costs and vaguely sense the rest — or they work from a rough estimate that hasn't been updated since fuel prices changed. This guide shows you how to build an accurate cost per mile calculator in Excel, walks through every cost component you need to include, and introduces tools that automate the mileage calculation side of the equation so your numbers are always based on real distances.

What Is Cost Per Mile and Why It Matters

Cost per mile (CPM) is the total operating cost of running a vehicle divided by the total miles that vehicle traveled in a given period. It's expressed as a dollar amount per mile — for example, $1.85/mile — and represents the actual cost to your business of moving a vehicle one mile, accounting for all expenses, not just fuel.

Here's why it's the most critical metric in a delivery or logistics operation:

It's Your Pricing Floor

You cannot profitably price a delivery run at less than your cost per mile. If you don't know your CPM, you can't know whether a $2.50/mile quote covers your costs or loses money. A delivery business that prices based on gut feel or industry averages — rather than its own actual CPM — is flying blind.

It Reveals Profitability by Route

Not all routes are equally profitable. Urban routes may have a higher cost per mile due to stop-and-go traffic and longer dwell times, while highway routes have lower fuel consumption but higher depreciation. A transport cost calculator in Excel that captures mileage data by route lets you compare CPM across your entire delivery network and identify which routes to prioritize or reprice.

It Quantifies the Cost of Empty Miles

Every mile your truck runs empty is pure cost — no revenue, full expense. Delivery businesses with high empty mile ratios often have a CPM that looks acceptable when calculated on loaded miles only, but becomes unprofitable when empty miles are factored in. Your cost per mile calculator must include all miles — not just revenue runs.

It Drives Accurate Fuel Surcharge Decisions

When diesel prices jump $0.30/gallon, how much does that add to your CPM? If you don't have a CPM model, you don't know. A properly built Excel cost calculator lets you adjust fuel costs and instantly see the impact on your per-mile cost and profit margins — which tells you whether to absorb the increase or pass it to customers via a fuel surcharge.

The Cost Per Mile Formula, Broken Down

The core formula is simple:

Cost Per Mile = Total Operating Costs ÷ Total Miles Driven

But the complexity is in the numerator. "Total operating costs" has to include everything — not just the obvious items like fuel. Here's the expanded version:

CPM = (Fuel + Driver Wages + Insurance + Maintenance + Depreciation + Tolls + Overhead) ÷ Total Miles

For a multi-vehicle operation, calculate CPM per vehicle and then compute a fleet-weighted average. Vehicles with different fuel efficiency, maintenance histories, or insurance rates will have different CPMs — and you need that granularity to manage profitability accurately.

Profit Per Mile

Once you have cost per mile, calculating profit per mile is straightforward:

Profit Per Mile = Revenue Per Mile − Cost Per Mile

A positive number means your routes are profitable at the current rate. A negative number — even a small one like −0.08/mile — means you're losing money at scale. A delivery business running 3,000 miles per week at −0.08/mile loses $12,480 per year on operations that look fine on the surface.

Every Cost Component You Need to Include

Most operators undercount their costs because they only track the visible ones. Here's a complete list of what belongs in your cost per mile calculator:

Variable Costs (Change With Miles Driven)

  • Fuel: Your biggest variable cost. Calculate as: (miles driven ÷ average MPG) × current fuel price per gallon. Update this monthly when fuel prices change significantly.
  • Driver wages: For mileage-paid drivers, this is straightforward. For hourly drivers, calculate the wage cost per mile by dividing total driver labor cost by total miles driven per pay period.
  • Tolls: If your routes use toll roads, highways, or bridges regularly, toll costs are a real per-mile expense. Average them over your route history for the calculation.
  • Maintenance and tires: Oil changes, tire replacements, and routine service scale with mileage. Industry averages range from $0.08–$0.18/mile for commercial vehicles. Use your actual maintenance history for accuracy.
  • Fuel additives / DEF (for diesel): Diesel Exhaust Fluid consumption in modern diesel trucks is approximately 1 gallon per 50 gallons of fuel — a small but real variable cost.

Fixed Costs (Distributed Across Miles Driven)

  • Insurance: Commercial vehicle insurance is typically a monthly or annual premium. Divide the annual premium by annual miles to get the per-mile insurance cost. A common range for commercial liability coverage is $0.04–$0.12/mile for a cargo van, higher for semis.
  • Vehicle depreciation: A vehicle loses value every mile it's driven. Use the straight-line depreciation method: (purchase price − salvage value) ÷ expected useful miles. For a $45,000 cargo van expected to last 250,000 miles, depreciation is $0.18/mile (assuming $0 salvage).
  • Vehicle financing / lease payments: If you're paying a monthly note on your vehicle, divide annual payments by annual miles and add this to your CPM.
  • Licensing and registration: Annual registration fees, IFTA license fees, and any regulatory licensing costs — divide by annual miles.
  • Overhead: Your share of office expenses, software, dispatch labor, and administrative costs attributable to the vehicle. Overhead allocation varies widely but should not be ignored — these costs must be recovered through operations.

How to Build a Cost Per Mile Calculator in Excel

Here's how to structure a cost per mile calculator in Excel from scratch:

Step 1: Set Up Input Cells

Create labeled input rows for each cost category. Use named ranges (Ctrl+F3 in Excel) for readability — it's easier to write =FuelCost/TotalMiles than =B4/C4 when auditing your work later.

  | Cost Category          | Monthly Amount ($) |
  |------------------------|--------------------|  
  | Fuel                   | [input]            |
  | Driver wages           | [input]            |
  | Insurance              | [input]            |
  | Maintenance/tires      | [input]            |
  | Depreciation           | [input]            |
  | Tolls                  | [input]            |
  | Overhead allocation    | [input]            |
  | TOTAL COSTS            | =SUM(above)        |
  |------------------------|---------------------|
  | Total miles driven     | [input]            |
  | COST PER MILE          | =TotalCosts/Miles  |
  

Step 2: Add Revenue and Profit Calculation

Add a revenue section to the same sheet:

  | Revenue per delivery run | [input]         |
  | Average miles per run    | [input]         |
  | Revenue per mile         | =Revenue/Miles  |
  | Profit per mile          | =RevPM - CPM    |
  | Profit margin %          | =ProfitPM/RevPM |
  

Step 3: Add a Route-Level Analysis

The most useful version of this calculator operates at the route level — not just the fleet average. Create a second tab with columns for each route:

  | Route | Origin | Destination | Miles | Revenue | Gross Profit | Profit/Mile |
  |-------|--------|-------------|-------|---------|--------------|-------------|
  

The challenge here is getting accurate mileage for each route. Estimated or self-reported mileage introduces error that compounds across dozens of routes. The Excel Delivery Cost Calculator solves this by pulling real driving distances from Google Maps API directly into your spreadsheet — so every mileage figure in your cost model is based on the actual road distance, not an approximation.

Step 4: Build a Fuel Price Sensitivity Table

Add a simple data table that shows your CPM and profit per mile at different fuel price points. This is invaluable for financial planning and pricing decisions:

  | Fuel Price ($/gal) | Fuel Cost/Mile | Total CPM | Profit/Mile |
  |--------------------|----------------|-----------|-------------|
  | $3.00              | =formula       | =formula  | =formula    |
  | $3.50              | =formula       | =formula  | =formula    |
  | $4.00              | =formula       | =formula  | =formula    |
  | $4.50              | =formula       | =formula  | =formula    |
  | $5.00              | =formula       | =formula  | =formula    |
  

Use Excel's Data Table feature (Data → What-If Analysis → Data Table) to build this automatically.

Loaded Miles vs. Total Miles: The Number That Changes Everything

This distinction is where many delivery businesses mislead themselves on profitability. "Loaded miles" are the miles you drive while carrying a paying delivery. "Total miles" include loaded miles plus dead miles — driving to the first pickup, returning to your depot after the last drop, or repositioning between runs.

Consider a delivery driver who runs 80 loaded miles per day but drives 30 empty miles getting to the first stop and 20 empty miles returning to base. That's 130 total miles, but only 80 revenue-generating miles. If you calculate CPM on 80 miles and price accordingly, you're actually absorbing $0.50/mile in empty miles that you haven't accounted for.

Your cost per mile calculator in Excel should track both:

  • Total CPM: All costs ÷ all miles (gives your true cost floor)
  • Loaded CPM: All costs ÷ loaded miles only (gives you the effective cost of each revenue run)
  • Empty mile ratio: Empty miles ÷ total miles (your inefficiency metric)

If your empty mile ratio exceeds 25–30%, route optimization typically pays for itself quickly. See the Excel Route Optimizer for tools that reduce empty miles through intelligent stop sequencing.

Using Cost Per Mile to Price Delivery Services

Once you have a reliable CPM figure, pricing delivery services becomes a structured decision rather than a guessing game.

Setting a Minimum Rate

Your minimum rate per mile must exceed your total CPM (including empty miles). If your total CPM is $1.65/mile and your average loaded mile ratio is 70%, your effective cost per loaded mile is $1.65 ÷ 0.70 = $2.36/mile. Any rate below $2.36/mile loses money when empty miles are accounted for.

Building in Margin

Target profit margins for delivery businesses typically range from 15–30% depending on the sector and competitive environment. Add your target margin to your break-even rate:

Minimum Quote = Effective Loaded CPM × (1 + target margin %)

Adjusting for Route Density

Dense routes (many stops in a small area) have lower CPM because fewer miles cover more deliveries. Sparse routes (long distances between stops) have higher CPM. Your pricing model should reflect this — flat per-mile rates work for predictable routes, but zone-based pricing often better captures the economics of varied route density.

Excel Tools for Delivery Cost Calculation

The manual approach to cost per mile calculation works, but it has one significant limitation: getting accurate mileage for every route in your operation is tedious if done by hand. The tools below automate the mileage calculation so your cost model is always based on real distances:

Excel Delivery Cost Calculator

The Excel Delivery Cost Calculator is designed specifically for delivery businesses that need to calculate the full cost of each run. It integrates with Google Maps API to pull actual driving distances, applies your cost per mile rate, and produces a per-delivery cost and profit calculation across your entire route list. Key use cases:

  • Quoting delivery jobs — know the actual cost of a run before you accept it
  • Comparing route options by cost
  • Calculating total delivery cost for invoicing or cost accounting
  • Identifying unprofitable routes in your current pricing

See the case study on how a business owner improved delivery service using the delivery cost calculator, and the guide on how logistics firms use the delivery cost calculator for pricing.

Mileage Reimbursement Calculator in Excel

For businesses that need to track and reimburse employee driving at the IRS standard mileage rate, the Mileage Reimbursement Calculator in Excel handles the mileage tracking, rate application, and reimbursement calculation in one spreadsheet. It's particularly useful for field service teams, sales teams, and any operation where employees drive their own vehicles for business purposes.

For a full guide, see how to calculate mileage reimbursement in Excel at the 2026 IRS rate.

Stop guessing at your route costs.
The Excel Delivery Cost Calculator pulls actual Google Maps distances into your spreadsheet and calculates true cost per delivery — so your pricing reflects your real costs, not estimates.

Frequently Asked Questions About Cost Per Mile Calculators in Excel

What is the formula for calculating cost per mile?

The basic formula is: Cost Per Mile = Total Operating Costs ÷ Total Miles Driven. Total operating costs must include fuel, driver wages, insurance, maintenance, depreciation, tolls, and overhead. For delivery businesses, calculate separately for loaded miles and total miles to see the true cost impact of empty running.

How do I build a cost per mile calculator in Excel?

Create input cells for each cost category, a SUM formula for total costs, an input cell for total miles, and a division formula for CPM. Add revenue inputs and a profit per mile calculation. For route-level analysis, add a second tab with a row per route and use a delivery cost calculator that pulls actual driving distances from Google Maps to ensure mileage accuracy.

What is a good cost per mile for a delivery business?

Cost per mile varies by vehicle type: cargo vans typically run $0.80–$1.40/mile, semi-trucks $1.50–$2.50/mile, passenger vehicles $0.50–$0.90/mile. These figures include all operating costs. The IRS standard mileage rate covers only the vehicle portion — it's not an adequate benchmark for total business CPM.

Why does knowing my cost per mile matter for delivery pricing?

Your CPM is your pricing floor. Without knowing it, you can't determine whether a quoted rate is profitable — especially when empty miles, fuel price changes, and maintenance costs are factored in. Delivery businesses that track CPM can price competitively without losing money and can adjust rates immediately when cost inputs change.

Can I calculate cost per mile for multiple vehicles in one spreadsheet?

Yes. Use separate rows or tabs per vehicle with a fleet summary sheet. This lets you identify high-cost vehicles that may need to be replaced, and compare the economics of different vehicle types in your fleet. The Excel Delivery Cost Calculator supports multi-vehicle calculations.