# How to Create a Rolling Chart in Excel?

Last Updated : 03 Jan, 2023

A chart range is a data range that automatically updates as the data source is changed. This dynamic range is then utilized in a graphic as the source data. As the data changes, the dynamic range updates instantaneously, causing the chart to refresh. A common necessity when developing reports in Excel is to report on a rolling basis. This may imply the previous 12 months, the last 6 weeks, or the last 7 days.  Whatever era is being reported, this might involve spending a significant amount of effort modifying chart sources and algorithms to display the correct data. To make a rolling chart, first, make two dynamic named ranges. These will automatically collect data from the previous six months. One named range contains the chart data, while the other contains the labels. We will then utilize these specified names as the source for our chart.

## Make a Dynamic Chart Range Using Excel Formula

Using Excel formula and named ranges, construct dynamic chart ranges. To make the named ranges dynamic, the OFFSET function will be employed. You may use this method to reference ranges relative to another range on a sheet. As a result, this may be used to grab the data. Example:

Step 1: Assume you have the following data set.

Step 2: Then, on the Ribbon, select the Formulas tab and then the Define Name button.

Step 3: After that, the Define Name dialogue box will display. You are free to use whatever name you choose. I named this one Monthsales and used the formula below in refers to section.

=OFFSET(Sheet1!\$B\$1,COUNT(Sheet1!\$B:\$B),0,-6,1)

Explanation: This formula begins at cell B1. It then scrolls down to the bottom of the column. The column bottom is determined by counting the number of values in column B. The -6 and 1 at the end of the calculation are used to retrieve the cell’s last 6 rows and 1 column.

Step 4: We must now construct a new dynamic named range for the chart labels. The following OFFSET function will be utilized.

=OFFSET(Monthsales,0,-1)

This function takes the previously provided name and chooses an equal height range one column to the left.

Step 5: The next step is to insert a chart using the named ranges as the data source. Navigate to the Insert tab. Insert the ‘Line with markers’ chart by clicking on ‘Insert Line or Area Chart.’ The chart will be inserted into the worksheet as a result of this.

Step 6: Now the Chart will appear like this.

Step 7: Go to the Chart Design Tab and click on Select Data after selecting the chart.

Step 8: Click the Edit button in ‘Legend Entries (Series)’ in the ‘Select Data Source’ dialogue box that appears.

Step 9: Cell B1 has been chosen as the Series name. The name of the data series is taken from the Sales heading. The Monthsales designated range has been input for Series Values. Keep the sheet name in there as well, as shown in the figure below, and then click OK.

Step 10: Click the Edit button again in the ‘Labels’ Section in the ‘Select Data Source’ dialogue box. The Chartmonths designated range has been typed in the Axis label range section and then click OK.

Step 11: In Excel, a rolling chart is built. When you add new rows to the table, the chart automatically refreshes to display the most recent six months.