I have a excel spreadsheet that has a currency rate for a certain period of time. I have taken the 5 day moving average/standard error of the mean using an input cell. Whatever the cell B1 value is, the mean should identify this and take the corresponding values from the spot rate to change the moving average range. For example, in the current spreadsheet, the input value is 5 so it has taken the 5 day moving average, but if I were to change this to 10, then it should identify this and take a 10 day moving average for the spot rates. Any ideas of how to do this?