To calculate MPG (miles per gallon) in Excel, use the formula =Miles/Gallons. For example, if your total miles are in cell A2 and your gallons used are in cell B2, enter =A2/B2 into cell C2 to get your fuel efficiency. This simple division allows you to track vehicle performance, monitor fuel costs, and identify changes in engine efficiency over time.

What You'll Need

  • A computer with Microsoft Excel installed (or a free alternative like Google Sheets).
  • Your vehicle's odometer readings (starting and ending mileage for a trip or fill-up).
  • The total amount of fuel added during your most recent fill-up (recorded from the pump receipt).
  • A basic understanding of how to enter data into cells and create a basic formula.

Step-by-Step

  1. Set Up Your Headers: Open a blank Excel workbook. To keep your data organized, create headers in the first row. In cell A1, type "Date". In cell B1, type "Odometer Reading". In cell C1, type "Gallons Added". In cell D1, type "Miles Driven". In cell E1, type "MPG". This structure ensures you can track your efficiency over multiple fill-ups rather than just a single trip.
  2. Enter Your Initial Data: In the second row (Row 2), enter the date of your first fill-up in A2, the odometer reading at that time in B2, and the number of gallons you pumped in C2. Since this is your starting point, you cannot calculate MPG yet because you don't know how many miles were driven since the previous fill-up. Leave D2 and E2 blank.
  3. Enter Your Second Fill-Up Data: In Row 3, enter the date of your next fill-up in A3, the new odometer reading in B3, and the gallons pumped in C3. Now that you have two data points, you can calculate the distance traveled.
  4. Calculate Miles Driven: Click on cell D3. To find the distance traveled between the first and second fill-up, you must subtract the previous odometer reading from the current one. Enter the formula =B3-B2 and press Enter. Excel will now display the total miles driven during that fuel cycle.
  5. Calculate the MPG: Click on cell E3. To find the miles per gallon, divide the miles driven by the gallons used for that specific trip. Enter the formula =D3/C3 and press Enter. The resulting number is your MPG for that interval.
  6. Format the Result: The MPG result often contains many decimal places (e.g., 24.384615). To make this readable, select cell E3, go to the "Home" tab on the ribbon, and in the "Number" group, click the "Decrease Decimal" button until only two decimal places remain.
  7. Automate for Future Entries: You do not need to type these formulas every time. Click on cell D3 and drag the small green square (the fill handle) in the bottom-right corner of the cell down through the rest of your column. Repeat this for cell E3. Now, whenever you enter a new odometer reading and gallon amount in the following rows, Excel will automatically calculate the miles and MPG.
  8. Create a Summary Average: To find your overall average MPG across all trips, go to a cell below your data. Enter the formula =AVERAGE(E3:E100) (adjusting E100 to match your last entry). This gives you a more accurate representation of your vehicle's efficiency than any single trip.

Common Mistakes

One of the most frequent errors is dividing the total odometer reading by the gallons added (e.g., 50,000 miles / 12 gallons). This will result in a massive, incorrect number. Always remember that MPG is based on the distance traveled since the last fill-up, not the total mileage of the vehicle. You must subtract the old odometer reading from the new one before dividing by fuel.

Another common mistake is mixing units of measurement. If you enter fuel in liters but calculate miles per gallon, the number will be meaningless. If you are using liters, you must either convert the liters to gallons (multiply by 0.264) or change your calculation to L/100km, which is the standard in many other countries. Ensure your fuel pump receipt is in the unit you intend to track.

Users also frequently forget to fill the tank completely. For the "full-to-full" method described here to work, the tank must be filled to the same level each time. If you only put in $20 of gas or fill it halfway, the amount of fuel added does not represent the fuel consumed during the miles driven, which will lead to wildly inaccurate MPG readings.

Tips

To get the most accurate data, use a "Log Sheet" approach. Instead of calculating a single trip, keep a running log for three months. This smooths out variables like heavy traffic, idling, or extreme weather changes that can cause a single tank of gas to seem unusually inefficient.

Use Conditional Formatting to spot problems early. Select your MPG column, go to Home > Conditional Formatting > Highlight Cells Rules > Less Than. Enter a number that is significantly lower than your car's rated MPG (e.g., if your car gets 30 MPG, set the rule to 20). If a cell turns red, it may indicate a mechanical issue, a sudden drop in fuel quality, or an error in your data entry.

If you want to track cost per mile, add a "Total Cost" column (Column F). Enter the price paid for the fill-up. In Column G, use the formula =F3/D3. This tells you exactly how many cents it costs to drive one mile, which is often more useful for budgeting than the MPG figure alone.

Troubleshooting

If you see a #DIV/0! error, it means Excel is trying to divide a number by zero or an empty cell. This usually happens in the first row of your data (Row 2) because there is no previous odometer reading to subtract from, or because you haven't entered the gallons used yet. You can fix this by simply ignoring the error in the first row or using the formula =IFERROR(D3/C3, ""), which tells Excel to leave the cell blank instead of showing an error message.

If the result seems impossibly high (e.g., 500 MPG), check your odometer subtraction. You may have accidentally referenced the wrong cell or entered a typo in the mileage. Double-check that you are subtracting the previous reading from the current reading, not the other way around. If you subtract the current from the previous, you will get a negative number.

If the formulas aren't updating when you change the numbers, check your Calculation Options. Go to the "Formulas" tab, click "Calculation Options", and ensure "Automatic" is selected. If it is set to "Manual", Excel will not recalculate the MPG until you press the F9 key.

Frequently Asked Questions

Can I calculate MPG if I don't use the odometer?

Yes, if your car has a "Trip A/B" meter, you can reset it to zero every time you fill up. In this case, you don't need to subtract odometer readings; you simply enter the trip meter value directly into the "Miles Driven" column.

How do I convert MPG to Liters per 100 Kilometers?

To convert MPG (US) to L/100km, use the formula =235.215 / [MPG Cell]. This is the standard conversion used to translate American fuel efficiency into the metric system used in Europe and Canada.

Why does my MPG vary so much between trips?

MPG is affected by many external factors. City driving with frequent stops, using the air conditioning, carrying heavy loads, and driving at higher speeds (over 60 mph) all significantly lower your fuel efficiency compared to steady highway cruising.

Should I use the car's built-in MPG display?

On-board computers provide a helpful estimate, but they are often optimistic. Manual calculation using the "full-to-full" method is the gold standard for accuracy because it relies on actual fuel dispensed at the pump rather than sensor estimates.

Can I track multiple vehicles in one sheet?

Yes. The best way is to create a separate tab (worksheet) for each vehicle. Right-click the sheet tab at the bottom of the screen, select "Rename", and name them "Car 1", "Car 2", etc., using the same column structure for each.