Master Excel: Crafting Mileage Formula in 5 Steps

Bobby Jul 15, 2026

Creating a mileage formula in Excel can be a breeze once you understand the basic structure of formulas and the functions Excel provides. This guide will walk you through the process, ensuring you calculate mileage accurately and efficiently. Let's dive right in!

a vehicle mileage log is shown in the form of a spreadsheet,
a vehicle mileage log is shown in the form of a spreadsheet,

Whether you're tracking personal driving, calculating company car allowances, or managing a fleet, having an automatic mileage formula can save you time and reduce errors. So, let's get started and make your Excel life a little easier!

How to Copy a Formula Down in Excel Using the Fill Handle
How to Copy a Formula Down in Excel Using the Fill Handle

Setting Up Your Mileage Calculation

The first step in creating your mileage formula is to set up your worksheet. You'll need columns for start and end mileage, date of journey, and any other relevant details like driver name or vehicle type.

ms excel formula
ms excel formula

For this example, assume your data is laid out like this:

DriverDateStart MileageEnd Mileage
A2022-01-01100150
B2022-01-02200280
the top 15 excel formulas are in green and white, with numbers on each side
the top 15 excel formulas are in green and white, with numbers on each side

Calculating Daily Mileage

Now, let's create a new column for 'Daily Mileage', calculating the difference between 'End Mileage' and 'Start Mileage'. Use the following formula and drag it down for each day in your dataset:

=B2-C2

⚡ 13 Powerful Excel Formulas You Need to Master Today!
⚡ 13 Powerful Excel Formulas You Need to Master Today!

This formula will automatically calculate the mileage for each driver each day. If a cell is left blank, Excel will simply skip it and not cause an error.

Total Mileage by Driver

Next, let's find the total mileage for each driver. Assuming your data is sorted by Driver and Date, use the SUMIF function in a new column for 'Total Mileage':

Create a simple formula in Excel
Create a simple formula in Excel

=SUMIF(A:A, A2, D:D)

This will sum up all daily mileage for the driver in A2, displaying their total mileage at the bottom of your dataset.

How to use frequency formula in excel
How to use frequency formula in excel
How to Use IPMT Formula in Excel
How to Use IPMT Formula in Excel
Excel Formulas You Should Know
Excel Formulas You Should Know
Excel formulas
Excel formulas
the cover of 3 amazing excel formulas that will blow your mind
the cover of 3 amazing excel formulas that will blow your mind
[FREE TUTORIAL] NEW Excel Lambda Formula!
[FREE TUTORIAL] NEW Excel Lambda Formula!
Mileage Tracker Spreadsheet with Auto IRS Rate for Excel and Google Sheets
Mileage Tracker Spreadsheet with Auto IRS Rate for Excel and Google Sheets
how to calculate hours worked
how to calculate hours worked
Pass Fail Formula Excel
Pass Fail Formula Excel

Calculating Costs

Now that you've got your mileage sorted, let's calculate costs. You'll need to know your vehicle's fuel consumption and the current fuel price. Assuming these are 6mpg and $4 per gallon, respectively, add new columns for 'Fuel Used' and 'Cost':

Fuel Consumed Each Day

In 'Fuel Used' column, divide daily mileage by vehicle's fuel consumption:

=D2/6

Calculating Daily Fuel Cost

Finally, in 'Cost' column, multiply fuel used by fuel price per gallon:

=E2*4

Now you have your daily fuel costs automatically calculated!

Total Cost by Driver

To find the total cost for each driver, use the SUMIF function again:

=SUMIF(A:A, A2, G:G)

This will sum up all daily fuel costs for each driver at the bottom of your worksheet.

And there you have it! Your custom mileage and cost calculation formula in Excel. This should save you time and make managing mileage claims a breeze. Happy tracking!