I have attached a sample of the a loan amortization table. The data is repeated until the loan amount is zero. After that, the calculations stop. attachment_1.xlsx

I would like to have the same sort of thing for a SP 500 data table I am creating. The idea is to insert a number of years to look back and then repeat the calculations for the point to point change in value for that number of years. I assume there is a way to repeat the calculations just for the number of years desired. Here is what I have so far S&P Data.xlsx