How to Calculate a Moving Range in Excel (4 Methods)

We have a dataset of some Product List and their Total Sales in quantity. We are going to calculate the moving range using formulas.


Method 1 – Apply the AVERAGE Function to Calculate the Moving Range in Excel

Steps:

  • Choose a cell to apply the formula. Here, I have selected cell (D7) as we take 3 intervals to get out the moving range value.
  • Enter the following formula:
=AVERAGE(C5:C7)

Where,

  • The AVERAGE function returns the average value inside a given string. Here, we have provided the cells (C5:C7); thus, the average value for the cells is “67.”

Apply AVERAGE Function to Calculate Moving Range in Excel

  • Press Enter to get the output.
  • Drag down the “fill handle” to fill all the cells with the moving range.

We have successfully calculated the moving range, indicating the average sales quantity from the product list.

Apply AVERAGE Function to Calculate Moving Range in Excel


Method 2 – Use the Data Analysis Tool to Calculate Moving RangeSteps:

  • Press the “Data Analysis” option from the “Data” option.

Use Data Analysis Tool to Calculate Moving Range

  • A new dialog box named “Data Analysis” will appear.
  • From the new window, choose “Moving Average” and press OK to continue.

  • In the new dialog box, choose your “Input Rangecells (C5:C13).
  • Choose an interval as we determine the average value with 3 values. We put “3” in the “Interval” section.
  • Select the “Output Range” from your dataset to view your calculated output.
  • Check mark the “Chart Output” if you want to get the chart in your worksheet.
  • Press OK.

Use Data Analysis Tool to Calculate Moving Range

  • We have the moving range values in our selected output cells with a chart.

Use Data Analysis Tool to Calculate Moving Range


Method 3 – Calculate the Moving Range for the Last N-th Values in Excel

Steps:

  • Choose a cell (D13) to apply the formula.
  • Enter the following formula:
=AVERAGE(OFFSET(C5,COUNT(C5:C100)-3,0,3,1))

Calculate Moving Range for the Last N-th Values in Excel

Formula Breakdown:

  • COUNT(C5:C100)→ In this part the COUNT function is counting how many values are available in Column C and providing an output-”9” as we have a total of 9 values in the column.
  • OFFSET(C5,COUNT(C5:C100)-3,0,3,1)→ The OFFSET function takes the cell reference C5 and then selects the range by taking the starting and ending point from the argument to calculate.
  • Here, “-3” indicates 3 rows up, “0” order to stay in the same column, “3” means consisting of total 3 rows, and “1” indicates a total of 1 column.
  • AVERAGE(OFFSET(C5,COUNT(C5:C100)-3,0,3,1))→ In the end, the AVERAGE function returns the average value from the selected cells in the range.

 

  • Press the Enter button.
  • We have successfully calculated the moving range for the last 3 cells in Excel.


Method 4 – Calculate the Moving Range for Insufficient Data in Excel

Steps:

  • Choose a cell (D5) and enter the following formula:
=IF(ROW()-ROW($C$5)+1<3,NA(),AVERAGE(C5:C7))

Where,

  • The IF function generates values with the help of the ROW and AVERAGE functions. If the value for this argument “ROW()-ROW($C$5)+1” is less than “3,” then show “#N/A,” and if not, display the average value.

Calculate Moving Range for Insufficient Data in Excel

  • Press Enter and drag the “fill handle” down to fill all the cells.
  • We have the moving range output in our hands using a simple formula.

Calculate Moving Range for Insufficient Data in Excel


Things to Remember

  • If you haven’t enabled the “Data Analysis” option, you won’t be able to enjoy the fantastic feature. To enable it, go to File > Options > Add-ins. From there, choose “Analysis Toolpak” and click OK. That’s it.

Download the Practice Workbook

Download this workbook to practice.


Related Articles


<< Go Back to Range Formula in Excel | Excel Range | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Wasim Akram
Wasim Akram

Wasim Akram holds a BSc degree in Industrial and Production Engineering from Ahsanullah University of Science and Technology. Over the past 2 years, he has been actively contributing to the ExcelDemy project, where he has authored more than 150 articles. Now, he is working as an Excel VBA and Content Developer. He likes learning new things about Microsoft Office, especially Excel VBA, Power Query, Data Analysis, and Excel Statistics. He is also very interested in machine learning and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo