I have 3 columns of data: country, year, calorie intake. I want to calculate a 5-year moving average for the calorie intake of each country. I know the formula to calculate a moving average. However, I need the moving average to restart for every country. Also, the number of years (rows) for each country is irregular (some have 10 years, others have 8 years).
I have attached a sample of my data. Thank you in advance!
Bookmarks