Go straight to the guide
LaneMile

Cost a mile in Excel: 3 rounding cases explained

LaneMile Editorial Team · Published · 11 minute read

Sources checked

Scope: use the jurisdiction stated in the guide and its sources.

LaneMile drafting rules: editorial standards.

Round cost a mile in Excel with ROUND: use positive digits for decimals and round only the final report rate.

Key takeaways

  • Keep raw costs and miles separate from rounded report figures.
  • Choose decimal places to match the purpose of your rate.
  • Reserve whole-dollar rounding for totals you report in whole dollars.
  • Match the cost period to the mileage period before dividing.

Why the last digits matter

You add up what the truck costs over a period, such as fuel, insurance, tires, repairs, permits, and the truck payment. Then you divide that total by the miles the truck ran in the same period. The result is a rate you can set against the rate a broker offers you. Use that comparison when you check load board rates before booking.

Excel makes the division easy. The trouble starts with the number you choose to show. Say your sheet produces a rate with several digits after the decimal point. On screen, you might format the cell to show only two decimals, so the displayed value looks shorter than the stored one. A gap of a fraction of a cent a mile feels harmless when you look at one mile. Multiply that gap across a full year of driving, and it can add up to a meaningful sum of money. The arithmetic works the same way with your own numbers.

Rounding is the step where you decide how much of that gap to keep. Excel gives you a function for it, ROUND, and the function behaves in one of three ways depending on a single argument. Once you know those three cases, you can pick the one that fits the number in front of you instead of guessing.

This post covers each case with formulas you can type into a sheet. It also covers rounding too early in cost sheets. It ends with a check you can follow the next time you update your numbers.

How ROUND reads its second argument

The ROUND function takes two arguments. The first is the number you want to round. The second tells Excel how many digits to keep. In Microsoft's reference for the function, that second argument is called num_digits, and the reference describes it as something that "specifies the number of digits to which you want to round number."

That one value controls where the rounding lands. Microsoft's reference page for the function describes the three cases below.

The page is written for the VBA object model, where the function appears as WorksheetFunction.Round. In a cell, you call the same function by typing ROUND. Use this formula:

	
	=ROUND(number, num_digits)

	
	

You will usually point number at a cell rather than type a value. For example, =ROUND(B4, 2) rounds whatever is in B4 and leaves B4 alone. The rounded result appears in the cell where you typed the formula.

Before choosing a case, remember that num_digits is a count of digits, and its sign tells Excel which side of the decimal point to work on.

Case 1: num_digits greater than zero

Use this case when you want a number with decimal places. Cost a mile is almost always a decimal, so this is the case you will use most often.

Set up a small example. Put total costs for the period in B2 and total miles in B3. Use your own figures from the period you are measuring. The steps are the same whatever the amounts are.

In B4, calculate the rate with =B2/B3. Leave this cell alone. It holds the full value, and later steps can depend on it.

Next, in B5, enter =ROUND(B4, 2). The cell returns the rate rounded to two decimal places, which is cents a mile. In B6, enter =ROUND(B4, 3) to keep one more decimal place. Three decimals is a finer figure that keeps more of the detail. Under the Microsoft rule for positive digits, both results are rounded to the number of decimal places you asked for.

Which one should you pick? It depends on what the number is for. If you quote a rate a mile to a broker or a customer, two decimals gives you a figure in cents. If you track the rate across several months to see whether costs are climbing, three decimals can show small changes that two decimals would hide. Either choice is reasonable. What matters is that you choose on purpose and write it down.

Here is a point that trips people up. Suppose you format B4 to show two decimals and then multiply it by your annual miles. In this example, compare the raw rate with the rounded report rate before multiplying. The displayed figure and the calculated figure can then disagree, and nobody notices until a total looks wrong. If you want a calculation to use the rounded value, the ROUND has to be inside the formula that feeds the calculation. Formatting alone will not do it.

Also decide on decimals before you share the sheet. If a colleague sees a rate shown to cents in one cell and to a third decimal in another, they may think one of them is wrong. Label each cell with its purpose, such as "Cost a mile, rounded to cents," so the intent is clear to anyone who opens the file. Labels cost you nothing and save a lot of questions.

Case 2: num_digits equal to zero

When num_digits is 0, the rule is that "number is rounded to the nearest integer." The result has no decimal places at all, and it becomes a whole number. That makes this case useful for some figures and wrong for others.

Look at what happens when you apply it to the rate from the last section. The formula =ROUND(B4, 0) returns a whole-dollar rate. A rate that is a little under one dollar rounds to one, which can differ substantially from the original rate. If you round mile rates to whole numbers, you can lose useful detail.

Where whole-number rounding does help is with totals. Suppose your annual cost total in B2 has cents in it. The formula =ROUND(B2, 0) returns that total rounded to the nearest whole dollar. That is a clean figure for a budget line, a summary you send to your accountant, or a line in a note to a business partner. Whole dollars are easy to read and easy to check against a statement.

There is one trap here. Do not round the total first and then divide by miles to get the rate. Rounding the total to the nearest dollar changes the amount you divide, so the rate shifts too. Use the raw total for the rate and the rounded total only for the report line.

A quick rule for this case: whole-number rounding fits a total you report in whole dollars. If the number is a rate in dollars a mile, leave it alone and use case 1 instead.

Case 3: num_digits less than zero

Microsoft's rule for negative digits is that "number is rounded to the left of the decimal point." A negative num_digits moves the rounding into the whole-number part. With -2, Excel rounds to the nearest hundred. With -3, it rounds to the nearest thousand. Each step to the left gives you a coarser figure.

Using the total from the last section in B2, the two formulas look like this:

  • =ROUND(B2, -2) for a planning total in hundreds of dollars.
  • =ROUND(B2, -3) for a planning total in thousands of dollars.

This case is useful for planning targets. Suppose you need to tell your bank, your partner, or your own team the yearly figure you must cover to keep the truck running. A number rounded to the nearest hundred is easier to remember and easier to say out loud than the exact total with all its cents. The rounding happens only on the report line. The working cell still holds the exact total, so your rate calculations stay precise.

Negative digits do not suit a mile rate. If you apply =ROUND(B4, -2) to a hypothetical rate under one dollar, the result is zero. Match the case to the size and purpose of the figure.

Illustrative example: keep the rate separate

For an illustrative period, total costs are 100 dollars and total miles are 10. Dividing gives a cost of 10 dollars a mile. Keep that calculation in B4 and use =ROUND(B4, 2) for the report rate. Separately, an illustrative planning total of 75 dollars becomes 100 dollars with =ROUND(75, -2). That planning figure belongs on the report line, while the original total stays available for calculations.

Round once, at the end

Rounding in the middle of a sheet can change the final total. Say fuel cost a mile is rounded to two decimals, insurance cost a mile is rounded to two decimals, and the two rounded figures are then added together. Each step drops some decimal detail. Across many cost lines, the total can drift away from the figure you would get by adding the exact values and rounding once at the end.

The drift is hard to predict by eye. Some steps round up and some round down, so the error can go either way. You can see it only by comparing the two versions.

The fix is a simple layout with three layers. The first layer holds inputs: the raw amounts you type from bills, fuel card exports, insurance statements, and your logbook. The second layer holds calculations: the totals, the miles, and the cost a mile, all with no ROUND in any cell. The third layer holds the report: the rounded figures you show to other people, each one labeled with its decimal places or its purpose. When checking fuel inputs, you can also net fuel card cashback from diesel cost.

If your sheet pulls data from another file or an export, the same rule applies. Keep the imported numbers exactly as they arrive, and round only in the report layer. If you find a ROUND sitting inside a cost line, move it to the report layer and check whether the totals changed. Sometimes they do not, and that is good news. Sometimes they do, and then you have found a difference to investigate.

One more detail: make sure the period matches. A month of costs must be divided by a month of miles, and a year of costs by a year of miles. A mismatched period can throw the rate off by a wide margin. Rounding comes last, after you have confirmed that both numbers cover the same stretch of time.

Checking the mileage rate on the IRS page

Some owner-operators compare their cost a mile with the IRS business mileage rate. The two numbers answer different questions. Your cost a mile tells you what your own truck costs to run. The IRS rate is a figure the IRS publishes for business driving. Keep them in separate, clearly labeled cells, and do not round one to match the other.

The IRS publication this post relies on is Publication 15-B, the employer's guide to fringe benefits. It states that "The business mileage rate for 2026 hasn’t yet published at the time this publication was published." It then directs readers to "Go to IRS.gov/Pub15B for the updated mileage rate for 2026." The publication is on the IRS site at this link.

The same publication also points readers to the same address for changes made after it was published. It names legislation enacted later as one example. So a figure you copied from an older guide, a forum, or a spreadsheet may no longer be current. Treat any mileage figure as something to confirm on the day you use it, not something you memorize.

When you put a mileage rate in your sheet, write down where it came from and the day you looked it up. Put that note in the cell next to the rate, or in a comment on the cell. Then, before you use the figure in a report, look at the source again. This takes a minute, and it keeps an old number from quietly carrying through your whole sheet.

Setting up the sheet

A layout that holds up over time has four blocks. You can keep them on one tab or split them across several tabs, whichever is easier for you to read. The blocks follow the three layers from the previous section, with a label block at the top.

  • Labels: a short description of each row, the period it covers, and the unit, such as dollars or miles.
  • Inputs: one row for each cost category, with the raw amount for the period.
  • Calculations: total costs, total miles, and cost a mile, with no ROUND in any of them.
  • Report: the rounded figures you show to others, each labeled with its rounding.

Use this layout:

	
	Row  Label                                   Formula
2    Total costs for the year, raw           your total from bills and statements
3    Total miles for the year                your total from your logbook
4    Cost a mile, raw                        =B2/B3
5    Cost a mile, rounded to cents           =ROUND(B4, 2)
6    Annual cost target, nearest hundred     =ROUND(B2, -2)

	
	

In this layout, only the last two rows round anything, and both of them sit in the report layer. The raw figures in rows 2 through 4 stay exact. If you later change a cost or a mileage figure, every rounded cell updates from the exact numbers, and nothing gets rounded twice.

Protect the calculations from accidental edits if other people use the file. A cell that someone overwrites with a typed number breaks the chain of formulas without any warning. A simple lock on the calculation cells, or a note at the top of the sheet, is enough for most small operations.

Check your sheet today

Open your current sheet and compare the raw rate with its rounded report cell. Confirm that both use costs and miles from the same period.

Rounding questions

Which case fits a rate quoted in cents?

Case 1 fits a rate quoted in cents. Use the decimal-place example above and label the report cell clearly.

Where should a planning target go?

Put a planning target in the report layer. Keep its original total in the calculation layer so later rate calculations can use it.

Sources for this guide

This guide provides general information, not legal, tax, financial or safety advice. LaneMile is not a regulator, load broker, dispatch service or compliance certifier. Apply the authority and vendor guidance for your own operation.