+ Reply to Thread
Results 1 to 8 of 8

Generate chart from drop-down list of values

  1. #1
    Registered User
    Join Date
    05-04-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2002
    Posts
    5

    Generate chart from drop-down list of values

    Hi,

    I am trying to generate a chart which would have:
    - On the X axis, the "parameter": all the values included in a drop-down list (created with data validation)
    - On the Y axis, the "results": the values taken by another cell (the content of the cell changes when the parameter is changed from the drop-down list).

    In the attachment, please make as if the "SupportSheet" worksheet did not exist, and assume you only have the "Chart" worksheet. My issue is that the result is generated from a series of complex calculations from a different file, so it is not trivial to create a table with all the values to be charted.

    I am using Excel 2002 (sic), but could get hold of a more recent version if needed.

    Thanks in advance for your help!
    Attached Files Attached Files
    Last edited by karakahva; 05-13-2010 at 06:38 AM.

  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: Generate chart from drop-down list of values

    k,

    I'm not sure I understand what you want to do. You show a line chart, instructing to forget about the Support sheet, but you only have one x and one y value on the chart sheet. So, where is the data for the chart supposed to be coming from? Even if it is created with complex calculations, it has to be somewhere in a table format for the chart to draw the values.

    I think this needs a bit more background.

    cheers

  3. #3
    Registered User
    Join Date
    05-04-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Generate chart from drop-down list of values

    Hi Teylyn,

    Thank you very much for your reply.

    I attach a new sample file, closer to what I'm doing. I'm trying to do a forecast of some estimates in the next few years, for different scenarios. While before we only needed to know the results in a specific year (see "Results" sheet: when you change the year in the drop-down menu, the results change), now we need to graph the change throughout the years. Hence the question: is it possible from such a sheet to chart the results for all the years?

    I understand that I could change the approach and restructure the model in order to generate tables with the result trends per year (and maybe have the scenario in the drop-down menu), but this would take a major effort (the model in the sample file is very much simplified compared to the actual one); that's why I hoped there was an easy way to generate the chart from the drop-down menu (year in the X axis and corresponding result in the Y axis). But if there isn't, I'll just have to restructure the model I guess.

    Thanks a lot!

    K.
    Attached Files Attached Files

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

    Re: Generate chart from drop-down list of values

    Oioioi!

    This is indeed a complex operation. The bottom line is: if you want to chart the data, you'll need the data in a table in a sheet.

    Maybe someone more versed in VBA than I am can come up with a UDF that can do the calculations and write the results into a table that feeds the chart.

    Other than that, I think remodelling is you next best option.

    Sorry.
    Last edited by teylyn; 05-05-2010 at 05:35 AM.

  5. #5
    Registered User
    Join Date
    05-04-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Generate chart from drop-down list of values

    Hi Teylyn,

    Thank you again for your reply. Unfortunately, that's what I feared after looking around in the Net and not finding any solution. I don't know VBA at all, so I hoped there would be a different way to do it (as learning VBA would probably take me more time than remodeling).

    Anyway, thanks again and I welcome any further advice!

    K.

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

    Re: Generate chart from drop-down list of values

    This will create a matrix of the 6 scenarios for all years.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  7. #7
    Registered User
    Join Date
    05-04-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Generate chart from drop-down list of values

    Wow!

    Thanks Andy...

    I've been offline for a few days, but I'll test it at once...

  8. #8
    Registered User
    Join Date
    05-04-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2002
    Posts
    5

    Re: Generate chart from drop-down list of values

    Hi all,

    I stumbled in an easier solution for my problem, and I wanted to post it here for the record, hoping it will be useful to someone in the future.

    I was looking for a way to do sensitivity analysis, and I found that it's quite easy to do "What-If" analysis in Excel. Basically you just have to create a table with all the potential values for your input cell, then with the Data/Table (or Data/What-If Analysis/Data Table) function it's possible to generate all the results corresponding to the different inputs. This way you can actually generate a table from a drop-down list of values, and from there it's immediate to make a graph.

    The method is better explained in the following URL:
    http://www.treeplan.com/chapters/02_...71029_1042.pdf

    I also attach my "solved" second sample file.

    Big thanks to everybody who helped!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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