"Three men go into a motel. The desk clerk said the room was $30, so each man paid $10 and went to the room. A while later, the desk clerk realized the room was only $25, so he sent the bellboy to the three guys' room with $5. On the way, the bellboy couldn't figure out how to split $5 evenly between three men, so he gave each man $1 and kept the other $2 for himself.
This meant that the 3 men each paid $9 for the room, which is a total of $27. Add to that the $2 the bellboy kept and the total is $29. Where is the other dollar?"
So you see, it is easy to subtract one thing from another and come up with some very, very wrong answers.
In most wealth calculations, the best way to figure this out is by NET WORTH calculations. At the end of the day, how does this affect your overall net worth? If you try to isolate one interest payment and compare it to another interest earning you are adding the bellboy's theft in twice. You compare apples and oranges and get confused.
So let's calculate how these transactions affect overall NET WORTH after five years and the loan is paid off or the equivalent amount of the loan is invested.
NOTE: This analysis works for paying off existing debts or paying off or paying down mortgages as well. However, there are "other factors" at work here as well. For example, if you aggressively pay down your mortgage, that is a fine thing. But if you fail to build up any savings at all, and you lose your job, you may find it hard to make the mortgage payment at all, and end up in foreclosure.
Thus, a balanced approach to savings and debt may make more sense - particularly when you are young and can afford to gamble (literally) on long-term high-yield investments.
But for old farts like me, it makes little sense to gamble on a possible return on the stock market, when I can get a guaranteed rate of return in paying off debt.