Dynamic Chart Updating

troy_lee

Board Regular
Joined
Feb 6, 2008
Messages
169
Column A on a datasheet is the week number. This is the chart's X axis. Column C is the value that gets plotted on the Y axis.

I want to make the chart dynamic so that every week when I add a new row, the chart's data range not only expands to include the new row but also readjusts the first row of the range to be one more than the previous week. In this manner I would always have only 52 weeks graphed on the chart.

Thanks in advance for the help.

Troy
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Named Ranges are the way to go here. Use the following menu path to get there:

3372797083_469ce16917.jpg


3373614900_2936bbfaf1.jpg


Once you are there, click in the box at the top (where you see "Staff_Name" in my example) and type a name, maybe "Weeks". Then click in the "Refers to" box and enter this formula:
=OFFSET(Sheet1!$A$1,COUNT(Sheet1!$A:$A),0,-52,1)
then click "Add". This will add the named range and activate it. If you now click in the "Refers to" box again, you should get the "dancing dots" box around the last 52 week numbers on the page. If not, the formula needs to be adjusted. Do the same for a new named range, maybe call it "data", defined by this formula:

=OFFSET(Sheet1!$C$1,COUNT(Sheet1!$C:$C),0,-52,1)

You can then replace the references in your Source Data with these names, and the data will march down the sheet as your data grows. So instead of X Values and Y Values being defined as:

=Sheet1!$A$2:$A$53 and =Sheet1!$C$2:$C$53

you would change it to:

=Book1!Weeks and =Book1!data
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top