+ Reply to Thread
Results 1 to 8 of 8

HOw to make a chart range dynamic

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    HOw to make a chart range dynamic

    Hello. How can I make a chart range dynamic and have it include only the range where cells are active?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: HOw to make a chart range dynamic

    I actually found some relevant online content, but the problem is that I will have NA values and while my chart ignores these NA values (i.e. it doesn't extend the line) it still extends the axis. For example, if I have four points, and then two NA points, there will be six hash marks and I just want 4.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: HOw to make a chart range dynamic

    Working with your sample in Book3.xlsx.

    Create a named range, for example call it Chart_Range note that I have used an underscore, not a space, there are a few restrictions on valid names.

    Change the 'Scope' dropdown to 'Sheet1' (or the name of the sheet holding the source data). This step shouldn't be necessary but it can eliminate potential errors.

    In the 'refers to' box enter this formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then edit your chart to use the data source =Sheet1!Chart_Range.

    Note that this only exclude errors that appear after the last numeric value in the range, if you have n/a in the middle of your data then you will still see blank columns.

  4. #4
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: HOw to make a chart range dynamic

    This is good. It still keeps the markers on the horizontal axis, which is strange. How can I eliminate that?

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: HOw to make a chart range dynamic

    Is there any kind of numeric value after the NA markers in your sheet?

    I tried it on your sample before posting and changed some of the values to N/A, I'm sure it resized the chart.

    I'll double check it when I get home.

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: HOw to make a chart range dynamic

    My bad, it doesn't resize if you enter the named range as the main chart range, (excel converts the dynamic named range back to a fixed range there).

    However, it does work if you use it in the chart series.

    Using your sample sheet from post #1. Go to the name manager and define the named range as before (skip this step if you already have a saved file with this done).

    Select the chart. Then in the Excel ribbon, navigate to Chart Tools - Design - Select Data.

    In the popup box, don't enter the named range in the 'Chart Data Range' box, instead, click on 'Edit' under the 'Legend Entries (Series)' heading, and enter the name reference =Sheet1!chart_range in the 'Series Values' box, then Ok / Accept until you get back to the sheet.

    Now the markers on the axis should only show when there is a value to be displayed.

    Note that on more complex charts, it might be necessary to use multiple named ranges.

  7. #7
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: HOw to make a chart range dynamic

    Sweet. That worked. What's the difference between the two?

    Also, what is the last part of the formula doing? The part with the match and the 1E =Sheet1!$B$3:INDEX(Sheet1!$B$3:$I$3,0,MATCH(1E+100,Sheet1!$B$3:$I$3))

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: HOw to make a chart range dynamic

    The first lets you set a single range, such as a table to produce a simple chart. The second one lets you specify non-contiguous ranges for each axis.

    1E+100 is a big number in scientific notation, 1 followed by 100 zeros. It is used to find the position in the last number of the match range.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Make a Dynamic Chart
    By krunk in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-04-2014, 04:53 AM
  2. How to make a Chart using a dynamic range?? (Need Macro?)
    By jaredmccullough in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2014, 03:50 PM
  3. How to make a chart as dynamic as possible
    By nchinas in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 03-02-2014, 04:41 PM
  4. [SOLVED] Trying to Make Dynamic Chart
    By droid_interceptor in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 11-21-2012, 03:54 PM
  5. Dynamic Range Column Chart w/ Dynamic Avg Line (Excel 2007)
    By BrokenBiker in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-04-2012, 11:40 AM
  6. [SOLVED] Can't make Dynamic chart work
    By leem in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-31-2012, 08:34 AM
  7. How to make a chart dynamic using VBA
    By sach_83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2011, 08:51 AM

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