How to Calculate Mileage Reimbursement Using IF Logic in Excel
Question details
The user needs to calculate travel mileage reimbursement conditionally based on whether a one-way or round-trip option is selected.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating travel expense tracking and mileage reimbursement calculations in a spreadsheet.
- Observed behavior
- The user wants to multiply mileage by the reimbursement rate, dynamically switching between one-way and round-trip distances based on a 'Yes' input in the round-trip column.
Ensure your spreadsheet is organized with distinct columns for the round-trip indicator (e.g., Yes/No), one-way miles, round-trip miles, and the reimbursement rate.
Use an IF Function to Calculate Mileage Reimbursement
This method utilizes a straightforward IF formula to check if the trip is round-trip, automatically applying the correct mileage calculation.
The IF function in Excel checks whether a condition is met, returning one value if true and another if false. By checking the round-trip column for 'Yes', you can direct Excel to multiply the rate by the round-trip miles or the one-way miles accordingly.
Identify the columns containing your round-trip indicator (e.g., Column D), one-way miles (e.g., Column E), round-trip miles (e.g., Column F), and the reimbursement rate (e.g., Column G).
Click on the cell where you want the total reimbursement to appear. Type the formula =IF(D2="Yes",F2*G2,E2*G2).
Press Enter to calculate the first row. Click and drag the fill handle at the bottom-right corner of the cell down to apply the formula to the remaining rows in your table.

Calculate Mileage Reimbursement Easily with WPS Spreadsheet
WPS Office provides a highly compatible and free Spreadsheet tool that supports all standard Excel formulas, including IF and OR logic, making expense tracking simple.
- 1. Open your expense report: Launch WPS Spreadsheet and open your mileage reimbursement document.
- 2. Input the IF formula: Select the target cell and enter your conditional formula, such as =IF(D2="Yes",F2*G2,E2*G2).
- 3. Fill down the calculation: Double-click or drag the fill handle downwards to automatically calculate the reimbursement for all your travel entries.

Frequently Asked Questions
Can I use both IF and OR logic together for more complex mileage rules?
Yes. If you have multiple conditions, such as checking if a cell says 'Yes' OR 'Y', you can nest an OR function inside the IF statement like this: =IF(OR(D2="Yes", D2="Y"), F2*G2, E2*G2).
Why is my IF formula returning an error instead of the reimbursement amount?
Errors usually occur due to incorrect cell references or missing quotation marks around text values. Ensure that text criteria like "Yes" are wrapped in double quotes and that your multiplication references point to cells containing numbers, not text.
How do I fix the reimbursement rate so it doesn't change when I drag the formula down?
If your reimbursement rate is stored in a single specific cell (e.g., H1) rather than a column, you must use absolute references by adding dollar signs (like $H$1) in your formula: =IF(D2="Yes", F2*$H$1, E2*$H$1).




