(Sorry. Meant to post this under charting. Could a mod please move it for me? Thanks.)
How's it going, Gurus.
I've tried everything I know to make this chart graph a dynamic range of data. I've searched this site, googled it, and read numerous articles, but I'm apparently missing something. Every formula I've tried gives me an error.
All I'm looking to do is have this chart (attached) update automaticially when I insert cells and new data before the range B21:B51. Here's the formula I've tried for the TOP line on the chart, "NASHVILLE".
I get the error, "That function is not valid".HTML Code:=SERIES('Hub In Stock %'!$A$45,COUNTA('Hub In Stock %'!$B$23:$IV$23),COUNTA('Hub In Stock %'!$B$45:$IV$45),22)
What am I doing wrong?
Thanks in advance for any help you can offer.
Last edited by hutch@edge.net; 03-11-2009 at 02:39 PM. Reason: Posted in wrong forum
Hi,
this will work best if you use range names for your data series and make the range names dynamic. Use Insert - Name - Define to create range names for each series, using the OFFSET function in the range name description to make it dynamic.
syntax =OFFSET(reference, rows, cols, height, width)
Example range name definition, let's say you call the range "MyRange":
=OFFSET(A24,0,1,1,COUNTA(24:24)-1)
explanation:
offset reference = A24 (reference point of your offset definition)
offset rows = 0 (stay in the same row)
offset cols = 1 (move one column to the right)
height of range = 1
width of range = count the number of cells with content and subtract one for the text in column A
You can now use the range name "MyRange" in the data source for the series, BUT you have to use the following naming convention:
='ExcelFileName.xls'!MyRange
If you enter just =MyRange into the data source field, it will throw an error message.
You'll need to create dynamic range names for all your data series, but you could use a formula like
=OFFSET(MyRange,1,0)
for the second series, so you only define a base series and offset all other series from that one.
Understand?
teylyn
Microsoft MVP - Excel
At Excelforum, you can say "Thank you!" by clicking theicon below the post.
Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.
Good morning, teylyn. Thanks for the response.
Apparently I don't understand. You explaind it well, it's just that I'm an idiot!
Here's what I've done..., In the attached workbook I have defined 2 names. (In excel 2007 you go to "Formulas", "Define Name".) I selected the cell A24, selected "Define Name", named it "ONTARIO", and entered the following formula:
=OFFSET('Hub In Stock %'!A24,0,1,1,COUNTA('Hub In Stock %'!24:24)-1)
I then used your advice and defined "STOCKTON" usuing this formula:
=OFFSET(ONTARIO,1,0)
If I check the name manager in Excel, I see that both names exist, and refer to the right range. Now, applying that range to the chart is where I'm running into problems. If I select the "Ontario" range in the chart, the formula bar has this formula in it:
=SERIES('Hub In Stock %'!$A$24,'Hub In Stock %'!$B$23:$P$23,'Hub In Stock %'!$B$24:$P$24,1)
I have tried several different iterations to make it recognize "ONTARIO" as the range to reference, but had no luck. Here are a few formulas I've tried:
=SERIES('Hub In Stock %'!ONTARIO)
=SERIES('Hub In Stock %'!$A$24,'Hub In Stock %'!$B$23:$P$23,'Dynamic Chart.xls'!ONTARIO,1)
='Dynamic Chart.xls'!ONTARIO
None of them appear to work. I'm sorry to be such a bother, but what am I doing wrong? I've attached the workbook with the names defined. Any help would be GREATLY appreciated.
Have a good one.
Your problem is the references in your named ranges are relative, so will keep changing. You need to make them absolute.
So ONTARIO
=OFFSET('Hub In Stock %'!$A$24,0,1,1,COUNT('Hub In Stock %'!$24:$24))
I added another named range to do the category axis labels.
CLABELS: =OFFSET(ONTARIO,-1,0)
Finally series formula would be,
=SERIES('Hub In Stock %'!$A$24,'Dynamic Chart.xls'!CLABELS,'Dynamic Chart.xls'!ONTARIO,1)
Okay, that's almost got me, with a couple of questions.
1. For some reason my date labels disappeared.
2. The formula in the formula bar disappears after I enter the dynamic formula. It appears I may have entered a couple of named ranges wrong, because if I select one of the lines in the chart, and scroll using my arrow keys, some of the lines don't appear. Where would I check to see if I have entered the formula correctly, not that it's not visible in my formula bar?
I've attached my latest attempt. This one is named the same as my actual workbook, so you can see where my range names are coming from.
Thanks for all the help!
Hutch
Select the chart
Chart Tools > Design > Select Data > Edit
which series had data labels applied?
were all points labeled?
Finally!! It looks like everything is working correctly.
After double-checking all the formulas, and making a few small corrections, I had everything working correctly in the simplified version I had posted. It was a little tricky getting the chart worksheet back into the complete workbook of the same name, but I finally figured out a way.
Thanks for all your help, guys.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks