+ Reply to Thread
Results 1 to 14 of 14

Dynamically Remove a Series on a Chart Based on Cell Value

  1. #1
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Dynamically Remove a Series on a Chart Based on Cell Value

    I have a situation that I need to not plot a data series if a cell value "Benchmark=NO" is NO. I have attached a workbook that has two tabs one for "Data" and one for Charting the data "Chart". The first chart on the Chart tab shows how all the data is normally plotted. If Cell "D10" is "NO" then I do not want the "Benchmark" data plotted automatically. The desired result is the second chart where "Benchmark" is removed.

    Does anyone know how to do this?
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Dynamically Remove a Series on a Chart Based on Cell Value

    maybe this: =IF($D$10<>"NO",$T1,"")
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    I have to apologize, my example makes no sense, as it had formulas in it that resulted in all the values being zero. Here is a new example.
    Attached Files Attached Files

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Benchmark is hardcoded and I think it shouldn't because this simple formula will not be flexible but you can do what you want of course
    Attached Files Attached Files

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Dynamically Remove a Series on a Chart Based on Cell Value

    You can use this version and change Benchmark in BenchmarkValues then use Yes or No from D10
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Quote Originally Posted by sandy666 View Post
    Benchmark is hardcoded and I think it shouldn't because this simple formula will not be flexible but you can do what you want of course
    Thanks sandy666, I tried your solution but it still plots the "benchmark" when the formula is not "Yes". It plots it's value as zero (0) but does not remove the "benchmark" from the legend. Making the value a blank does not work. Thanks anyway!!

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Dynamically Remove a Series on a Chart Based on Cell Value

    You chart from second example doesn't contain data from benchmark
    also turn on Automatic Calculation

    automatic.jpg

    I think you need create chart again with Benchmark then use Yes/No

    so try this:
    Attached Files Attached Files
    Last edited by sandy666; 01-13-2018 at 07:19 PM.

  8. #8
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Quote Originally Posted by sandy666 View Post
    You chart from second example doesn't contain data from benchmark
    also turn on Automatic Calculation

    Attachment 556025

    I think you need create chart again with Benchmark then use Yes/No

    so try this:
    The legend still shows the endesired red line but now it says #N/A I need that series completely gone. Thanks again.

  9. #9
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Quote Originally Posted by sandy666 View Post
    You chart from second example doesn't contain data from benchmark
    also turn on Automatic Calculation

    Attachment 556025

    I think you need create chart again with Benchmark then use Yes/No

    so try this:
    I still get the legend with the undesired "red" line now labeled "#N/A". see attached picture.
    Attached Images Attached Images

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    in C5 : =IFERROR(CONCATENATE("Benchmark"," (",TEXT(D5,"0.0%"),")"),"")
    but red line still will be there. It can be accepted?

    or maybe it will help: Dynamic Excel Charts
    Last edited by sandy666; 01-13-2018 at 08:07 PM.

  11. #11
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Hi sandy666, I am still struggling with this issue. Your last solution works but as you stated the Red Line is still in the legend. If there was a way to change the color of the line to White dynamically, the line would not be seen. Any ideas?

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Maybe with VBA
    without it you can simply change border color to no line and font to white or set transparency to 100% for both - text and line, but.... it will not be visible whatever you select Yes/No

    did you read Peltiertech link from post #10?
    Last edited by sandy666; 04-19-2018 at 01:48 PM.

  13. #13
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Yes I did read the Link, and it did not make too much sense to me, so it was not helpful in my case

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Dynamically Remove a Series on a Chart Based on Cell Value

    Perhaps this will be of some help. Working with the 'Normal' chart in the file Sandy666 attached to post #7 and the IFERROR addition to the formula in post #10, consider the following:
    Delete Benchmark... from the chart ledgend
    Select the first (or last) data point in the line graph for the benchmark and select 'Add data label'
    Immediately select that same data point again and select 'Format data label' then uncheck 'Value' and check 'Series name'
    Note that when cell D10 on the data sheet is changed to 'NO' both the line graph and series name disappear.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] dynamically update chart based on cell value
    By Bax in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-06-2015, 09:13 AM
  2. [SOLVED] Is it possible to dynamically update a charts data series, based on another cell
    By missydanni in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-14-2013, 11:29 AM
  3. Dynamically Updating Chart - Multiple Series based on Advanced Filter
    By alexbell2 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-12-2012, 06:52 AM
  4. Replies: 6
    Last Post: 07-09-2012, 02:17 PM
  5. Chart: add series dynamically (no macro)
    By davidebed in forum Excel General
    Replies: 3
    Last Post: 11-12-2010, 10:26 AM
  6. Dynamically changing the series of chart
    By bhokalivarun in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-25-2009, 04:02 AM
  7. use mouseclick to dynamically change chart series? Chart_beforeDoubleClick?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2006, 10:25 AM

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