+ Reply to Thread
Results 1 to 7 of 7

Dynamic Chart

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Dynamic Chart

    (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".

    HTML Code: 
    I get the error, "That function is not valid".

    What am I doing wrong?

    Thanks in advance for any help you can offer.
    Attached Files Attached Files
    Last edited by [email protected]; 03-11-2009 at 01:39 PM. Reason: Posted in wrong forum

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Dynamic Chart

    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?

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Dynamic Chart

    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.
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Dynamic Chart

    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)
    Cheers
    Andy
    www.andypope.info

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Dynamic Chart

    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
    Attached Files Attached Files

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Dynamic Chart

    Select the chart

    Chart Tools > Design > Select Data > Edit

    which series had data labels applied?
    were all points labeled?

  7. #7
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Dynamic Chart

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1