This formula and idea originally came from Russ Glines at Century Oak Mortgage. You enter the interest rate of your loan, the quoted APR and the loan amount. It figures the rest.
There is ANOTHER VERSION that goes the other way; you give the upfront costs and it finds the APR.