+ Reply to Thread
Results 1 to 23 of 23

Create Dynamic graph

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,669

    Create Dynamic graph

    I have a sheet of data (see enclosed).

    I have created dynamic graphs before but this graph is a little different. In my other graphs that i have done the dynamic variable is the x-axis.......like if i were adding a new month. But in this one I am adding a new month but the month is not the x-variable (see enclosed file). As such i am not sure how to make this graph dynamic.

    In this graph the x-variables are static........

    Any ideas?
    Last edited by welchs101; 06-28-2011 at 07:47 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Create Dynamic graph

    Quote Originally Posted by welchs101 View Post
    I have a sheet of data (see enclosed).
    There is nothing attached to this post.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,669

    Re: Create Dynamic graph

    sorry, i thought i uploaded it but i guess i did not........sorry about that.
    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,449

    Re: Create Dynamic graph

    Turn your data in to a table.
    Create a chart based on the table
    Switch chart row/columns data
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,669

    Re: Create Dynamic graph

    what do you mean by turn it into a table..........fyi: i have excel 2007

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

    Re: Create Dynamic graph

    Select range A1:F4
    use ribbon Insert > Tables > Table

    The use Insert > Charts > Column chart.
    Use Chart Tools > Design > Data > Switch Row/Column

    The chart will now automatically expand in series when rows are added.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Create Dynamic graph

    Assuming your data header begins in row 1 column A like your example, set up a LstRow Defined name as follows
    LstRow = COUNTA($A:$A) (this assumes no blank rows in column A)

    Assuming you want to chart the last 12 rows of Column B
    GraphRng1 = INDEX($B:$B,LstRow-11):INDEX($B:$B,LstRow)
    Xaxis = INDEX($A:$A,LstRow-11):INDEX($A:$A,LstRow)

    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  8. #8
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,669

    Re: Create Dynamic graph

    ok, where do i put these named ranges so that adding another month would plot automatically?

  9. #9
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,669

    Re: Create Dynamic graph

    no it does not appear to work. the x-axis should be the values in row1.....B1, C1, D1, E1, F1.

    For example: For the 1A: I should see the last 12 months of data for 1A. Similarly, for 2B i should see the last 12 months for 2B.

    Its a weird graph.........but this is what i have to plot.

    Does this make sense?

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

    Re: Create Dynamic graph

    If you create a chart table based on the last 12 entries in your expanding data table you only need define 1 named range for the source data.

    The chart can be made on the static range.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,669

    Re: Create Dynamic graph

    hummm, let me take a look at that. wont be able to get to it for about 1hr..........

    THanks again for all the help.

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Create Dynamic graph

    I did end up creating 12 defined names for the 12 series. I think Andy's technique is much better for a number of reasons but, if you want to see how it was done, see attached. For the Series names/legend, I used this formula dragged down 12 rows

    =TEXT(INDEX($A:$A,LastRow-ROW(A1)+1),"mmm' yy")

    Reference those cells for the series names when adding series to the chart. Typically, I would hide these cells or put them underneath the graph.
    Attached Files Attached Files
    Last edited by ChemistB; 06-24-2011 at 11:16 AM.

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Create Dynamic graph

    FYI, you needed to expand your range to J1:O13 on your graph. The graph will ignore all the series where the x value is N/A so there is not an issue there. Hope that helps.

+ 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