When pump prices for gasoline spike, some drivers get the gut feeling that trading that 14-MPG Ford Expedition for a 50-MPG Toyota Prius (numbers from the EPA’s fuel economy website) will carve hundreds or thousands off their fuel bills. If you’ve ever considered doing so, it’s a good policy to look before you leap or, in the case of Nissan’s electric vehicle, before you Leaf.

The first step is to calculate a basic cost-per-mile difference between the two vehicles due to their fuel economy. That’s simple arithmetic you can do on a calculator or, if you recall long division, with pencil and paper. Start by estimating the average cost you will pay per gallon of gasoline over the next year or so (the US Energy Information Administration publishes such estimates). Second, divide that cost by the EPA estimate of combined city/highway mileage. Here’s an example:

You’re driving a 2008 Ford Expedition 2WD with a V8 engine. According to your records (you *do *keep records, don’t you?), you average 14.5 MPG in your SUV. You’ve read that over the next year, gasoline is predicted to average $3.55 per gallon in your area. The fuel cost per mile to drive the Expedition, then, is $3.55 divided by 14.5, or just under 25 cents per mile. Ouch: no wonder you want to trade in!

You have your heart set on a new 2013 Ford Escape with the 2.5-liter 4-cylinder engine. According to the EPA’s 2013 guide, the new Escape gets a combined 25 MPG. The gas cost per mile for the Escape would be $3.55 divided by 25, or 14.2 cents per mile. The difference between the two is 25 minus 14.2, or 10.8 cents per mile. Write that down.

Now comes the hard part; even harder than long division. You need to calculate your cost to buy a new Escape less the trade-in for the Expedition. That’s dependent on a lot of different factors: the trade-in value and loan balance (if any) on your old vehicle, selling price of the new vehicle, and so forth. For this example we’ll pick a number more or less at random: say $9,000, including TTL. For now, we’ll ignore everything else.

Remember that number you wrote down before? (Hint: it was $0.108/mile.) Now, let’s calculate how many miles you’ll have to drive to recover the cost of buying a new vehicle on gasoline savings alone. That means long division again: divide the purchase cost by the per-mile cost difference to get a number we’ll call “recovery mileage”: $9,000 divided by $0.108 per mile is… drum roll… 83,333 miles. Whoa! If you’d decided on a 2013 Toyota Prius c instead (combined mileage 50 MPG), the recovery mileage would only be 40,909 miles (the per-mile difference works out to 22 cents). In case you didn’t know, however, an Escape is smaller, and a Prius c is much smaller, than your Expedition.

Of course, fuel economy is only one factor to consider. You must also consider differences in insurance, licensing and maintenance costs – especially as your current vehicle gets older. You certainly cannot ignore the predicted resale value of any new vehicle you may choose, as well as the costs of financing a new car. Yes: it’s complicated.