Creating automatically extended plot ranges

Excel 365 2016 2013 2010 2003
If you often need to adjust your data ranges so that your charts plot an updated data range, you may be interested in a trick that forces Excel to update the chart's data range whenever you add new data to your worksheet.

To force Excel to update your chart automatically when you add new data, follow these steps:

   1.   On the Formulas tab, in the Defined Names group, click Define Name:

Defined Names in Excel 2007

   2.   In the New Name dialog box, in the Name field, enter Date, and in the Refers To field, enter this formula:

= OFFSET (Sheet1!$A$2, 0, 0, COUNTA (Sheet1!$A:$A) - 1)


   3.   Click OK. Notice that the OFFSET function refers to the first data point (cell A2) and uses the COUNTA function to get the number of data points in the column.

Because column A has a heading in row 1, the formula subtracts 1 from the number.

   4.   Type Sales in the Name field, and in the Refers To field enter

= OFFSET (Sheet1!$B$2, 0, 0, COUNTA (Sheet1!$B:$B) - 1)


   5.   Click OK to close the dialog box.

   6.   Activate the chart and select the data series. In this example:

Series in Excel 2007

   7.   Replace the range references with the names that you defined in Steps 2 and 4:

  • Series X values: Sheet1!Date
  • Series Y values: Sheet1!Sales

After you perform these steps, when you add data to columns A and B, the chart updates automatically to show the new data. To use this technique for your own data, make sure that the first argument for the OFFSET function refers to the first data point, and that the argument for COUNTA refers to the entire column of data. Also, if the columns used for the data contain any other entries, COUNTA will return an incorrect value.

The Chart with automatically extended plot ranges in Excel 2007

If you have any questions or suggestions, please feel free to ask OfficeToolTips team.

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you’ve provided to them or they’ve collected from your use of their services.

Learn more