I'm looking for a VBA code to calculate a Canadian mortgage payment (interest compounded semi-annually). I found the PMT code online, but it was for US mortgage calculations.

The regular PMT formula would be: =PMT(($A$2/2+1)^(2/12)-1,12*$A$6,AF30,0,0)*-1 where A2 would be the interest rate, A6 the amortization, and AF30 the mortgage amount.

I'm just doing a simple page to compare four different mortgage options side by side. There would be three variables that I would like to be able to solve for: payment (based on inputting a rate, mortgage amount and amortization), amortization (based on inputting a rate, mortgage payment and mortgage amount), and mortgage amount (based on inputting a rate, payment and an amortization).

It should also have the ability to calculate monthly, bi-weekly, weekly, semi-monthly, accelerated bi-weekly, and accelerated weekly.

Is this something someone could help me out with?