To calculate a simple moving average in Google Sheets for a series of values, you can use the AVERAGE function combined with a relative reference to create a rolling average.
For example, if you have your data in column A and you want to calculate a 3-day moving average, you could place the following formula in cell B4 (assuming your data starts in cell A1) to calculate the moving average for the first 3 data points and then drag the formula down to apply it to other cells
=AVERAGE(A1:A3)
As you drag the formula down, it will calculate the moving average for each set of 3 cells in column A.
Let's create a small dataset that you can use to test the calculation of moving averages in Google Sheets. Suppose you have the following daily sales data for one week:
Here's how you can calculate a 3-day simple moving average for this data:
To calculate the 3-day moving average starting from Wednesday (since the first two days don't have two preceding days to form a 3-day average), enter the following formula in cell C4:
=AVERAGE(B2:B4)
Drag the formula in C4 down to C8 to calculate the moving average for the rest of the week.
In column C, you'll see the moving average for each day starting from Wednesday. Remember, the formula =AVERAGE(B2:B4) calculates the average of Monday, Tuesday, and Wednesday. As you drag the formula down, the range automatically adjusts to calculate the 3-day average for the subsequent days.
We hope that this article has helped you and given you a better understanding of how to calculate a simple moving average in Google Sheets. If you enjoyed this article, you might also like our articles on how to insert the delta symbol in Google Sheets and how to use the Venn diagram in Google Sheets.