30 Advanced Excel Tips for 2026

Excel Champs / Excel Charts / Dynamic Chart Range
By Puneet Gogia (Microsoft MVP)

How to Create a Dynamic Chart Range in Excel

Click any cell in your data and press Ctrl + T (or Insert → Table), keep My table has headers ticked, and build the chart from the table. Rows you type directly below the table join it automatically, and the chart extends to include them.

To drop points, delete the rows from the table rather than clearing their cells: select them, right-click and choose Delete → Table Rows. Cleared cells stay inside the table, so the chart keeps empty slots for them.

Without a table, use dynamic named ranges. Go to Formulas → Name Manager → New, name it Amount, and in Refers to enter =OFFSET(Sheet1!$B$2,0,0,COUNT(Sheet1!$B:$B),1). Create Month the same way with =OFFSET(Sheet1!$A$2,0,0,COUNT(Sheet1!$B:$B),1). Both count the numbers in column B, so the labels and the values always stay the same length.

Point the chart at the names: right-click it, choose Select Data, select the series under Legend Entries (Series), click Edit and type =Sheet1!Amount in Series values. Then click Edit under Horizontal (Category) Axis Labels and type =Sheet1!Month. Include the sheet name; a bare =Amount is not accepted. Excel then shows the workbook name in place of the sheet name, which tells you the name is linked.

If the chart shows empty points or stray markers after your last value, the column probably holds formulas that return "". COUNTA counts those cells, which is why the formulas above use COUNT, which counts numbers only. And if Excel says a formula contains invalid references, check that the name is spelt exactly as you defined it.

I have a strong reason for you to use a dynamic chart range. It sometimes happens that you create a chart, and when you update the data, you have to change its range manually.

Even when you delete some data, you have to change its range. Maybe changing a chart range looks like no big deal. But what about when you have to update data frequently?

You do need a dynamic chart range.

Are you sure, I need a Dynamic Chart Range?

Yes, 100%. Alright, let me show you something.

how to create a dynamic chart range in excel monthly amount chart

Below, you have a chart with the month-wise amount, and when you add the amount for Jun, the chart values stay the same; there is no change. Now the thing is, you have to update the chart range manually to include Jun in the chart. So, what do you think: is using a dynamic chart range a time-saver?

Using Data Table for Dynamic Chart Range

If you are using Excel 2007 or a later version (including Microsoft 365), then using a data table instead of a normal range is the best way.

All you have to do is convert your normal range into a table (use shortcut key Ctrl + T) and then use that table to create a chart. Now, whenever you add data to your table, it will automatically update the chart as well.

how to create a dynamic chart range in excel using data table update data

In the above chart, when I added the amount for Jun, the chart got updated automatically. The only thing that leads you to the next method is that when you clear data from a table, the chart doesn’t shrink: the empty row stays in the table and in the chart.

how to create a dynamic chart range in excel data table delete data

The solution to this problem is to delete the table row itself (right-click ➜ Delete ➜ Table Rows) instead of just clearing the cells; the table and the chart then shrink.

Using Dynamic Named Range

Using a dynamic named range for a chart is a bit tricky, but it’s a one-time setup. Once you do that, it’s super easy to manage it. So, I have split the entire process into two steps.

  1. Creating a dynamic named range.
  2. Changing source data for the chart to dynamic named range.

Creating a Dynamic Named Range for Dynamic Chart

To create a dynamic named range, we can use the OFFSET function.

Quick Intro to Offset: It can return a range’s reference which is a specified number of rows and columns from a cell or range of cells. We have the following data to create a named range.

how to create a dynamic chart range in excel with dynamic named range

In column A we have months and amounts in column B. And, we have to create dynamic named ranges for both of the columns so that when you update data your chart will update automatically.

Download this file to follow along.

Here are the steps.

  1. Go to Formulas Tab -> Defined Names -> Name Manager.
    how to create a dynamic chart range in excel click name manager
  2. Click on “New” to create a named range.
    how to create a dynamic chart range in excel click new
  3. Now, in the new name window, enter the following formula (I will tell you further how it works).
    • =OFFSET(Sheet2!$B$2,0,0,COUNTA(Sheet2!$B:$B)-1,1)
  4. Name your range “amount”.
    how to create a dynamic chart range in excel enter formula
  5. Click OK.
  6. Now, create another named range by using the following formula.
    • =OFFSET(Sheet2!$A$2,0,0,COUNTA(Sheet2!$A:$A)-1,1)
  7. Name it “month”.
  8. Click Ok.

At this point, we have two named ranges, “month” & “amount”. Now, let me tell you how it works. In the above formulas, I have used the COUNTA function to count the total number of cells with a value. Then I have used that count as the height in OFFSET to refer to a range.

how to create a dynamic chart range in excel formula used

In the month range, we have used A2 as the starting point for OFFSET and counted the total number of cells with a value in column A with COUNTA (-1 to exclude the heading), which gives a reference to A2:A7.

Changing Source Data for the Chart to the Dynamic Named Range

Now, we have to change the source data to the named ranges we have just created. Oh, I am sorry, I forgot to tell you to create a chart, please insert a line chart. Here are the further steps.

  1. Right click on your chart and select “Select Data”.
    how to create a dynamic chart range in excel select data
  2. Under Legend Entries (Series), click on Edit.
    how to create a dynamic chart range in excel data table click edit
  3. In Series values, replace the range reference with the named range “amount”.
    how to create a dynamic chart range in excel add range name
  4. Click OK.
  5. Under Horizontal (Category) Axis Labels, click Edit.
    how to create a dynamic chart range in excel click edit axis range
  6. Enter the named range “month” for the axis labels.
    how to create a dynamic chart range in excel edit range in month
  7. Click Ok.

All is done. Congratulations, now your chart has a dynamic range.

how to create a dynamic chart range in excel chart is ready
Important Note: While using named range in your chart source make sure to add worksheet name along with it.

For example, enter =Sheet2!amount in Series values, not just amount. If you type only the name, Excel shows an error. After you click OK, Excel shows the reference with the workbook name instead of the sheet name, which is fine.

Use INDEX Instead of OFFSET

OFFSET is a volatile function, which means it recalculates every time anything changes in the workbook. In a big workbook, you can use INDEX instead; it gives the same dynamic range without being volatile. For the “amount” name, the formula would be:

=Sheet2!$B$2:INDEX(Sheet2!$B:$B,COUNTA(Sheet2!$B:$B))

Both versions count the values in the column, so they only work when the column has no blank cells in between and nothing else below the data.

Show Only the Last 6 Months

Sometimes you want the chart to show only the latest values, like the last 6 months, and move forward as you add data. Use this formula for the “amount” name (and the same with column A for “month”):

=OFFSET(Sheet2!$B$1,COUNTA(Sheet2!$B:$B)-6,0,6,1)

It starts from the last value, goes up 5 rows, and takes 6 rows, so the chart always shows the latest 6 months. You need at least 6 values in the column.

Sample File

how to create a dynamic chart range in excel sample file

Last Words

Using a dynamic chart range is a super time saver & it will save you a lot of effort. You don’t have to change your data range again and again. Every time you update your data, your chart is instantly updated.

Frequently Asked Questions

Which method should I use?

Use an Excel table in most cases, as it needs no formulas. Use a dynamic named range when you need more control, like showing only the last few months.

Why does my chart show extra empty points?

Either the table still has empty rows at the end, or the named range counts something below your data (like a total). Delete the empty table rows, or keep the column free of anything except the data.

Does a dynamic range work on a Mac?

Yes. Tables and named ranges with OFFSET or INDEX work the same way in Excel for Mac. You’ll find the Name Manager under Formulas ➜ Define Name.

16 thoughts on “How to Create a Dynamic Chart Range in Excel”

  1. When I paste the name range to the series name and the axis range it changes it to a simple range and it will be no longer dinamically.
    sheet1!chart –> sheet1!$A$1:$B$4
    What should I do?
    Thanks

    Reply
  2. So I have a problem where the worksheet including a chart needs to be duplicated within the same workbook.
    My dynamic ranges are scoped at the worksheet level, so that when duplicating the worksheet, they too duplicate.
    However, the duplicated chart does not bring that functionality across and instead hard codes the range on the new sheet.
    Any suggestions to get around this without the need to rebuild the plot references via macro?
    Thanks

    Reply
  3. I can get the “dynamic named range” method to work for columns with inputted values, but not for corresponding columns with formulas (They’re set to be blank if nothing is entered in the corresponding row). Will this only work for columns with manually inputted cells? Thank you.

    Reply
  4. You TOTALLY helped me solve a huge problem with variable data sets!! WooHoo! You are awesome!!! The Offset did the trick!! THANK YOU!!!!

    Reply
  5. You said use a Data Table, which you then said to create by pressing Ctrl+T but that does not give me a data table at all. Confused

    Reply
    • Make sure you have clicked “into” the data set. If you are clicked outside of the set, it will not create a Table. Yes, Ctrl+T is the trick. Or old-school, Insert > Table.

      Reply
  6. Oh my gosh! I can not thank you enough! This was so very helpful.

    Reply
  7. Puneet,

    I am trying to do this by the named ranges method. When I try to do this step –

    ‘In series values, change range reference with named range “amount”.’

    the system revolts, saying “A formula in this worksheet contains one or more invalid references” or “The formula you typed contains an error”. I am using a 64-bit Windows 7 machine.

    I have tried typing in the range as Sheet1!x (x is the name of my range of x values, and Sheet1 the sheet name) and also by Formulas-> Use in Formulas -> Paste Name, with and without the Sheet1! prefix. Neither method works.

    Would you know what is the problem?

    Perspective on my problem: I have a long data list of which I sometimes want to plot only 50 entries, sometimes 100 entries, etc. I actually want to put that parameter (the number of entries I want to plot) into a cell and have Excel plot accordingly. All the data is already there, I am not typing in new data I just want to control how much of it gets plotted.

    Reply
  8. Good day.
    I have read your tutorial and it is well appreciated. My graph is a bit different, so I will explain it.
    I have a data sheet which contains SPEED, say, column C. I am trying to draw a graph where I can pick two random points for my Y-Axis. I enter the start point and endpoint on another sheet say, INPUT (Cell E2 and Cell E3) which I can alter to create different start and end points. This means the start point will change as well as the end point. Though I have successfully drawn a graph with only one set points, whenever I change even the start point, the graph collapses. What can I do please. Thank you. Jacob

    Reply
  9. Hi, I am unable to edit under legend entries and horizontal.
    Please try to give easy way to make me understand because I am on biggner level.

    Reply
  10. The Name definition works for me as long as you add data, but if data is dynamicaly removed from the data range the graph then still shows the bubbles of the removed values. Can’t find a way to get rid of those

    Reply
  11. I am stuck building dashboards with changing requirements. I taught myself how to build dynamic ranges using the OFFSET formulas and all was good. For 3 minutes when my client said he wanted the ability to choose specific data points. My example is a rolling 5 period report. Month Month Month Quarter Month. I built it so the next month will go Month Month Quarter Month Month then Month Quarter Month Month Month next one is built to go QMMMQ. Here’s the rub…. next one should go MMMQM but he wants it to go QQM so that once a Quarter is completed by the three previous months they collapse into the Quarter and stack next to the previous Quarter. My offset only reads the previous 5 periods using a -5. Can and how to I amend my OFFSETS to accomplish the client request. Haven’t slept in days so any response appreciated. Thanks.

    Reply

Leave a Comment