+ Reply to Thread
Results 1 to 3 of 3

Change chart source dependant on cell contents

  1. #1
    Forum Contributor
    Join Date
    07-17-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel for O365
    Posts
    197

    Change chart source dependant on cell contents

    Hi all,

    Is it possible to change the source range for a chart dependant on the contents of a cell.

    Example worksheet attached!


    i.e...

    If C1 = "Yes", then use the cell range A3:C10, if not use cell range A3:B10.


    Many thanks in advance

    Jason
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Change chart source dependant on cell contents

    I would normally use named ranges to do this.

    Create a named range using the name manager and in the box for "refers to" enter the formula:
    =IF(Sheet1!$C$1="Yes",Sheet1!$C$4:$C$10,Sheet1!$B$4:$B$10)
    then give it a suitable name, for example chart_data

    Then in the source data for your chart enter the named range (you will need a sheet reference as well, for example Sheet1!chart_data

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

    Re: Change chart source dependant on cell contents

    If you use named range for the Source data reference the chart will be populated correctly but the series formula will be range references.

    This means when C1 changes the chart will not.

    You can use the named range approach but you need to define category and value ranges for each series.
    Cheers
    Andy
    www.andypope.info

+ 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. Change Chart Source Data series by changing cell
    By Hendra S in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2014, 02:09 PM
  2. Change source data of chart by adjusting two cell values
    By kadekl in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 10-19-2012, 05:54 AM
  3. Popup box with cell dependant contents
    By lee_shuttleworth in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2011, 06:08 AM
  4. Using contents of cell as source data for chart
    By cpenticuff in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-17-2009, 10:24 AM
  5. Replies: 2
    Last Post: 07-05-2009, 07:38 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