+ Reply to Thread
Results 1 to 4 of 4

dynamic chart range based on certain conditions

  1. #1
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    dynamic chart range based on certain conditions

    Hi forum Members,

    Pls help me I am try to create dynamic chart range based on certain conditions, in attached sheet tab "chart".

    wherein I want if U4 = "total sat score" then should chart range ab5:ab11

    else if U4 = "Weighted sat score" then should chart range ab5:ab10

    In the tab "my try" I try to solve it by using VBA. however I could not succeed.

    Pls let me know if it can done through VBA will be fine.

    Thanks
    Rishi
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: dynamic chart range based on certain conditions

    Use dynamic ranges. For example, define a name chdata with this as its range definition: =OFFSET(chart!$AC$6,0,0,6+(chart!$U$4="total sat score"))

    Then, select the chart's data source and edit the appropriate series. Change the 'Series values:' to =chart!chdata

    Perform a similar task for the percentages and the x-axes.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Forum Contributor
    Join Date
    11-12-2013
    Location
    Delhi
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: dynamic chart range based on certain conditions

    Not working,

    could you pls share the workbook if you got the result.....


    thanks
    Rishi

  4. #4
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: dynamic chart range based on certain conditions

    Hmmm, not sure why its not working for you. I have attached my example (note: I removed the macros since I don't allow them to run on my system, but the chart concept works - just change the text in U4).

    Another way to do this is to have your data in one section and then a 'smart data copy' in another section. The chart would use the 'smart data copy' and the data in it would be either a copy from the original chart or an NA. NA errors do not get charted. So, the equation where you want numbers to be included or not would be something like:
    =IF(U4="total sat score",AC12,NA())
    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)

Similar Threads

  1. [SOLVED] chart based on dynamic range which resizes as per data in range-formula / vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2014, 04:02 PM
  2. [SOLVED] Need ‘Set Print Area’ Code for Dynamic Print Range based on Conditions
    By dosbirn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 12:13 PM
  3. [SOLVED] Dynamic Ranking based on Conditions
    By compd1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2013, 07:30 AM
  4. Dynamic Range Column Chart w/ Dynamic Avg Line (Excel 2007)
    By BrokenBiker in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-04-2012, 11:40 AM
  5. Chart based on dynamic range
    By Chezterfield in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-15-2010, 03:52 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