+ Reply to Thread
Results 1 to 4 of 4

Dynamic Chart Adding New Variables to Line Plot

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    NY
    MS-Off Ver
    V10
    Posts
    13

    Unhappy Dynamic Chart Adding New Variables to Line Plot

    Hi All,

    I'm looking to build what I thought would be a rather simple dynamic chart that adds variables as rows of data are added to excel (with multiple not-changing columns). I feel as though I've done something similar before, but can't seem to get it to work based on the dynamic range tutorials I've followed via google searches (using basic offset formulas and defined named ranges). I'm not sure if it's because I have my data laid out incorrectly (and should flip-flop the X and Y axis), but please let me know if you have any thoughts.

    I've attached a very simple excel template that shows how my data is laid out and how I'd like the line chart to look. Ultimately, the "year headers" will remain the same (2017-2021) and there will be no additional columns added (should act as the X Axis). However, I do have some dynamic formulas that will add rows/countries (ex: Chicago and Barcelona) depending on what a user selects in another part of the sheet. The formulas in these cells either returns (ex: B6, B7, B8, B9, etc) a blank or a city.

    I'm hoping to be able to have the Line chart add/remove cities based on user input. It sounds easy and I thought I'd have this settled in a matter of minutes, but I can't seem to figure out how to accomplish this.

    Let me know if you have any questions. Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Dynamic Chart Adding New Variables to Line Plot

    Since you have Excel 2010, then you also have Excel Tables. Tables should solve the issue for you. In the attached workbook, I took the data you provided and converted it into an Excel Table. Then I selected a cell in the table and built the chart from it. I had to select Select Data and switch the rows and columns. Now when you add a row, the chart adds the new series (city). When you add a new column (year) the chart adds the new date.

    I was having an issue with the workbook you provided. When I added a row, I got an error message stating that there was something wrong with some formula somewhere, but it added the city and everything worked. If I transposed the table (dates in rows, cities in columns) I did not get the error.

    I copied the data to a fresh workbook and it's working.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    06-15-2015
    Location
    NY
    MS-Off Ver
    V10
    Posts
    13

    Re: Dynamic Chart Adding New Variables to Line Plot

    Hi! Thanks for the response. It seems like a neat idea and maybe I'm executing this incorrectly, but when I add a city (or multiple cities) to the table and then remove one (or two or three), the table doesn't adjust and the line graph still shows a space in the legend for that recently-removed variable. I think this may be a good approach for adding variables, but I'm looking for a more dynamic/flexible solution that will accommodate adding/removing variables and a table that grows/srhinks. Thanks!

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Dynamic Chart Adding New Variables to Line Plot

    I think it depends on how you remove the table entry. If you right click on a cell in the row you want to delete and then select Delete -> Table Row, it should work. Simply "blanking out" the data will leave a blank series.

+ 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. Adding a Dynamic "Target Threshold line" to a Pivot table and chart
    By ImokatExcel in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-30-2016, 03:02 PM
  2. How to set a dynamic sheet or a line number dynamic from variant variables
    By skulo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2015, 09:58 AM
  3. [SOLVED] How to plot a line with dynamic marker?
    By BNCOXUK in forum Excel General
    Replies: 2
    Last Post: 11-02-2012, 10:28 AM
  4. plot every Nth value in Line Chart
    By twd000 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-22-2010, 06:00 AM
  5. Line chart that does not plot zero values
    By TrolleyDude in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-25-2010, 07:08 AM
  6. Replies: 1
    Last Post: 06-20-2006, 08:45 AM
  7. [SOLVED] Getting a line chart to NOT plot a zero value
    By sheryl in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-26-2005, 09:05 AM

Tags for this Thread

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