Link to home
Start Free TrialLog in
Avatar of kwarden13
kwarden13

asked on

Make a Dynamic Chart w/ Drop Down

I want to make a chart with a drop down at the top for "category" and when you select a catergory it only shows those locations and points on the graph.

I have the following fields:
Category
Location
Data1
Data2
Data3

I want the category to include a drop down that when you select the category the graph changes accordingly. Also, there should be a catergory for ALL.

I have done this many years ago using the OFFSET function however I cannot fully remember how to do it.

PLEASE HELP!!!
Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand image

Hello,

how many rows with the same category will the table have? This approach is for unique categories:

In the attached sample, the data source is defined with an Offset function and a nested Match that finds the correct row.

cheers, teylyn
Book2.xlsx
You can do this with a pivot chart.  It will automatically give you the drop downs to select category if you make that a page field.  It's difficult to show you an example without seeing your data.   If you're prepared to post some sample data it would be easier.
I would agree with andrewssd3 that PivotCharts are a powerful solution for this kind of problem.  Attached is an attempt using Excel 2007.  If you need an Excel 2003 version then let me know.

Obviously the downside of the PivotChart is that the user interface is less customisable.
Book1.xlsx
Avatar of kwarden13
kwarden13

ASKER

I dont want a pivot
kwarden,

if my first suggestion and my guess at your data does not work for you, it would be good to see a data sample. Dynamic charting relies heavily on data layout and the dynamic range names must be properly defined.

The above is only one of many ways how it can be done. If your data is different, the approach will vary.

cheers,
teylyn's dynamic range names don't work for me - Excel 2007 chart seems to get upset by them (I remember this working in 2003, so perhaps I'm missing quirk of 2007).
Anyway I tried a different approach which does not use PivotTables and is a bit less elegant than dynamic range names ... but it does seem to work - see attached.  
As teylyn says, data structure is critical.  Here I've assumed that all the rows for each category come in a block.
Book6.xlsm
jan24,

To use a dynamic named range, you have to set the series value or labels like this:

='Name of file.xlsx'!Named_Range

or

='Name of sheet'!Named_Range

Do that, and it will work splendidly.  I do have a fondness for PivotCharts, though :)

Patrick
ASKER CERTIFIED SOLUTION
Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Attached is a data sample

teylyn: I like your method or something similiar, however can't get any of it to work. Can you save in a 2007 format?
datatest.xls
Hi, as I said above, the data must be sorted by category for this approach to work. If that is not an option, the you will need to use pivot tables. There is no formulaic way to create a dynamic range for data that is not contiguous.

I've saved the above file in Excel 2003 format.

When you apply the dynamic range names to the chart, you must enter them with the syntax

=SheetName!RangeName

or

=FileName.xls!RangeName

Entering just the range name will not be accepted.

cheers,

Book5.xls