Using Excel 2013 and Win 7. Trying to make a "simple" spreadsheet, to compare cost of leg of a trip. Stumped on how to calculate when at stop 2 or stop 3, we have purchased fuel at different prices. Need calculation to use all fuel purchased at original price first, then what was purchased at second leg next, and so forth. Don't always fill up, as many times, that is not ideal. Below is a walk-through of attached example file:
Starting with 79 gal that I paid $2.65 per gallon, for a transaction cost of $209.35. Then I depart, and first leg fly 385 mi. used 38.5 gal., which leaves 40.5 available space to refill. These people's fuel was high, so didn't purchase any, so leg cost is gal burned times cost per gal. Next leg, we go 135 mi., and are now down to 27 gal. So we buy 50 at $4.65/gal, and leg cost here will be same calculations as first, as still burning original fuel. But from here forward, I am lost on how to "use up all previous fuel cost, and start on next fuel cost, and next, etc. Any help will be greatly appreciated. I am aware second leg cost number is not accurate. I used same formula, as first leg, but on next set of cells, and that is when I became aware of error in my project. I also posted this at mrexcel.com a few days ago, but no solution from there yet. Thanks for any input.
Starting with 79 gal that I paid $2.65 per gallon, for a transaction cost of $209.35. Then I depart, and first leg fly 385 mi. used 38.5 gal., which leaves 40.5 available space to refill. These people's fuel was high, so didn't purchase any, so leg cost is gal burned times cost per gal. Next leg, we go 135 mi., and are now down to 27 gal. So we buy 50 at $4.65/gal, and leg cost here will be same calculations as first, as still burning original fuel. But from here forward, I am lost on how to "use up all previous fuel cost, and start on next fuel cost, and next, etc. Any help will be greatly appreciated. I am aware second leg cost number is not accurate. I used same formula, as first leg, but on next set of cells, and that is when I became aware of error in my project. I also posted this at mrexcel.com a few days ago, but no solution from there yet. Thanks for any input.