To calculate the annual percentage yield (APY), you must use this formula: APY= (1 + r/n )n n – 1. In this equation, “r” equals the stated annual interest rate, and “n” equals the number of compounding periods annually.