Has anyone used Offset to add columns of data to a chart rather than rows? I've played around with it and have never been successful in getting OFFSET to work with columns.
HI Luke- Thanks for the welcome. What I am trying to do is add columns to a chart and have the chart pick them up automatically as they are entered instead of having it pick up rows automatically.
For example, I have a chart that graphs product sales by month. In Column A, I have Products at cell A1, Widget1 at A2, Widget2 A3, Widge3 at A4 and then in Column B I have January Sales at B1, $100 in B2,$200 in B3 etc. I can chart that but I want the chart to automatically pick up the next Column so that when I enter February sales in Column C and March sales into Column D the data will automatically be included in the chart,
If you include the full range (say all twelve months) it will include the data as it is available, in Excel 2003 and below I used to insert #N/A in the coulmns that had no data and in that way the chart ignored these columns until data was placed in them.
As Luke said you can use Named Ranges for your series
In your case use a named Range for Widget 1 and set it to
Widget1:
Code:
=OFFSET(Sheet1!$A$2,,1,1,COUNTA(Sheet1!$B$2:$ZZ$2))
You will also need a Named Range for the Months
Months: =OFFSET(Sheet1!$A$1,,1,1,COUNTA(Sheet1!$B$1:$ZZ$1))
Setup your chart as normal
Using SheetName!Date as the X Axis and SheetName!Widget1 as the Values
This will extend automatically as data for subsequent months is added
It won't add new Widgets though, that has to be done manually
Hurray! Both methods worked. Kanti- using the #n/a is a nice and quick approach.I think I must be brain dead or need new glasses - in the Offset I kept putting a 1 in the row instead of the column and just kept repeating the same error over and over- Egads! Thanks again.