I see an issue with the mileage calculation. when i enter the first full fill up, there is no mileage associated with that, which is correct. But on subsequent fill ups, the mileage should be calculated for the last fill up, instead of current fill up. because with the current fill up i'm providing the actual distance the car traveled for the last fill up. So the calculated mileage should be pushed down to last fill up and current fill up should just be without mileage calculation.
i have created a simple excel with the same algorithm.
Please see if you find it useful
Customer support service by UserEcho