If you're one of those people who feels like your car is an old friend, deciding when it's time to let go can be agonizing. Even if you feel like your car is more your enemy than your friend, thanks to expensive and inconvenient repairs, deciding to pull the plug and get a new car can be tough.

Faced with an expensive repair bill, how do you know if you should go ahead and get the car fixed, or cut your losses and buy something new?

The Math Myth

At some point, almost every car owner will be faced with repair bills. And as the bills start to add up to a large proportion of a car's value, many owners start to figure that their car has officially kicked the bucket. But thinking that way is actually a costly mistake.

This way of thinking confuses a car's potential monetary value with its actual value. At a basic level, a car's value -- any car's value -- is its ability to provide transportation. An older car and new car can both do that. The question drivers whose cars are on life support should be asking is: How can I get the transportation a car provides at the lowest cost? Once you take a car's potential monetary value out of the equation, the math becomes clear.

For instance let's say you have a 2000 Honda Civic DX in fair condition with 100,000 miles on it. According to Kelley Blue Book, it has a trade-in value of about $2,000. Then let's say you need to have the head gaskets replaced. According to repair estimates from Repair Pal, in the DC metropolitan area, that can cost you anywhere from $861 to $1,135 -- about half the value of the car.

Faced with this, most people would opt to get a new car. After all, $1,000 worth of work is a lot to spend on a car that's worth only $2,000. But, you shouldn't act so quickly, because while it would take about $1,000 to keep that old Civic on the road, buying yourself a new Honda Civic costs about $16,000. Now the math isn't so clear, is it?

The Real Math

Here's the math any car owner should do when deciding if their older car has shuffled off the mortal coil: Compare the cost of the old car over a year to the cost of a new car over the same timeframe. Chances are, if your car is more than five years old, you're looking at some hefty repair bills. You're also probably looking at owning the car free and clear -- which means no more monthly loan payments.

Look again at the Civic situation. If you spend $1,000 a year on the old Civic, plus $1,571 a year on gas (that's what the EPA says it would cost to drive a 2000 Honda Civic 15,000 miles per year), that adds up to a total yearly cost of $2,571, plus insurance.

Now, let's take a look at the cost of a new Civic. Assume you can get one for $16,000 (which is about the average price buyers are paying for the car nationally, according to TrueCar, a company that collects new car pricing data), taxes, tags and title included. If you get $2,000 for trading in your old Civic, you're going to have $14,000 left to pay. 

According to Bankrate, if you get a four-year loan for that $14,000 at four percent interest, you're looking at a monthly payment of $323. Over a year, those payments add up to $3,869 -- plus gas, which the EPA says will run you $1,465 if you drive the new Civic 15,000 miles this year. Even before you factor in insurance costs, which tend to be higher for new cars, keeping the old Civic makes more financial sense. In fact, keeping it could save you $2,763 over the year.

Other Factors to Consider

Of course, there are other things you should think about. If your older car is consistently unreliable and causes you to miss work show up late, or repeatedly leaves you stranded along dark highways, it might be time for a new one. Also, there are some problems that are incredibly difficult and expensive to fix, pushing the cost of the old car above the cost of a new one. If your car has had a number of major issues, and your mechanic sees more coming down the pike, it might be time to start thinking about a new ride.

There are also some people who like getting a new car, and don't mind that they are spending more to do so. There's even the argument that getting older cars off the road in favor of newer, more fuel-efficient and less polluting models benefits all of us.

Still, when deciding if your car is finally dead, the one factor you shouldn't be looking at is the ratio between repair costs and the car's sale value. Instead, do a hard comparison of your old car's cost and what a new car would cost you over a year before you decide it's time to pull the plug.