I'm having a problem with plotting charts with dynamic ranges that is driving me up the wall at the moment.
The attached spreadsheet has six columns of data (Avals to Fvals) and cells H2 and I2 to determine the start of the series plotted, and the number of points to plot. The idea is eventually to attach these to scrollbars to allow interactive zooming and panning of the data on the chart.
I have defined six named dynamic ranges Arange to Frange using the OFFSET command - as far as I can see identically with the exception of the start column in each range.
The chart plots the data from Arange. Everything works correctly and if I adjust the values in H2 and I2 it selects a different part of the data correctly.
To change which range is plotted, if I click on the data series in the chart I can edit the SERIES function that appears in the formula bar to change it to Brange, and this works correctly. It also works correctly if I change it to Drange, Erange or Frange.
So the formula looks like
=SERIES(,,dynamicChart.xlsx!Frange,1)
However, if I change it to Crange instead, I am unable to update the formula. It reports no error, but the series doesn't update - in fact I can't do anything at all - if I hit Enter or click on the tick, nothing happens, and moreover I can't click outside the formula bar, for example to a cell; the cursor remains inside the formula bar. It will only allow me out if I change it to something different.
I cannot think of any logical reason for this behaviour - what is more, there is nothing wrong that I can see with the formula defining the named range
=OFFSET(Sheet1!$C$2,Sheet1!$H$2,0,Sheet1!$I$2,1)
and the others are all identical with, eg $A$2 instead of $C$2
If I do any other arithmetic on the named Crange (e.g. set a cell to =SUM(Crange) it produces the correct answer.
If I hit F5 and goto Crange, the correct range of cells is highlighted.
Only it obstinately won't plot in a chart.
I have found only one way round this problem, which is to define the range concerned as something different (e.g. the same as Arange). Then plot a chart with Crange selected, edit the series statement to have Crange in it, and then edit the definition of Crange in the Name Manager.
I first encountered this problem on Excel 2010, but the anomalous behaviour is exactly the same on Excel 2013.
This doesn't make any sense at all, can anyone help?
I have attached the file dynamicChart.xlsx, which exhibits the behaviour.
Regards,
Iain Strachan
Bookmarks