"What will be the amount in an RRSP at the end of 20 years if monthly contributions of $500 are made at the end of each month and the RRSP earns 6% compounded monthly for the first 15 years and 7.5% compounded monthly for the remaining 5 years."

The formula that I have is
Future Value = pmt {(1+i)^n - 1}
------
i
I am able to get the right answer when I put it into my calculator but every time I use the formula I am getting the wrong answer.
Please help =)