Could somebody tell me the formula for working out compound interest over a number of years?

Answer
A = p(1 + i)^n, where a = amount of money you would end up with p = principal, the amount invested i = interest rate, expressed as a decimal (i.e., .05 for 5% interest) n = number of years