Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic serie selection on an excel chart

Tags:

excel

I have a chart with a lot of series to plot. Somehow, these series are too numerous, so i want to only plot some of them. I can do this "statically", by hand, by duplicating the table and removing the unnecessary lines, but obviously, i would prefer something more dynamic, since new series are constantly introduced.

Typically, i want to only draw series which reach a certain threshold, or a certain rank. I can test the condition, and return a result such as 0 or 1 for example.

Now, i don't know how i can use this information to dynamically select the series that will be plotted into the chart. Is it even possible ?

like image 559
Cyan Avatar asked Sep 18 '25 15:09

Cyan


2 Answers

Another approach involving a table and its filters. Here is the starting table, series names in first column, categories in first row, last column has some formula testing the values, returning true or false.

Insert a chart using all columns of the table except the last, and you'll probably have to switch rows and columns, so the series are plotted by row.

Unfiltered table and chart

Click the autofilter dropdown in the header for the test column, and under Number Filters, select Equals, and enter True in the box.

Filtered table and chart

Your test formula need not return true or false, it may just calculate a function of the values, or whatever you want. Just pick a suitable filter condition to hide what you don't want to show in the chart.

like image 151
Jon Peltier Avatar answered Sep 21 '25 19:09

Jon Peltier


Yes.

Using dynamic ranges works very well with charts. There are two typical applications for this

  1. Using dynamic ranges where the series is known, but the length of the data set for the series is variable.Stephen Bullen's FunChrt1.zip is an excellent example of this technique. No VBA required

  2. When the number of series itself is variable than some basic VBA is required as when a dynamic range is assigned as a sourcedata range it becomes hard-coded (unlike a defined name for a specific chart series which stays "live"). This sounds like the approach for your query. Jon Peltier covers this well at Dynamic Chart Source Data

like image 29
brettdj Avatar answered Sep 21 '25 20:09

brettdj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!