How refinance is calculated
For each loan, cost over the horizon equals payments made plus remaining balance minus starting balance. Add upfront refinance fees to the new-loan cost. A positive difference favors refinancing under these assumptions.
Worked example
Replacing a $250,000 loan with the same rate and remaining term leaves interest unchanged. If the new loan costs $5,000 upfront, modeled savings are negative $5,000 at every shared horizon.