All,
I'm having a little trouble with the logic on this one. Consider the following simple example. Say my car gets 20mpg, I have a 15g tank, and I have a requirement to drive 100miles.
I want to write a formula that can dynamically calculate how many miles I can drive without running out of gas (up to my 100 mile requirement).
The formula would either result in the 1) total requirement of 100 miles or the 2) maximum number of miles I can drive until i run out of gas (if less than 100 miles).
So, if the fuel burned over the course of 100 miles is less than my 15g tank, then 100 miles is returned, otherwise return maximum number of miles I can drive until i run out of gas.
Thanks in advance.
Best,
Chris
Bookmarks