+ Reply to Thread
Results 1 to 3 of 3

Using a cells value to define chart data range

  1. #1
    Registered User
    Join Date
    02-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    2

    Using a cells value to define chart data range

    Hi,

    New to the forum and whilst not new to Excel, I'm not exactly proficient at it, please go gentle on me...

    So, my problem.

    Basically, I have a chart. This chart's horizontal axis will remain constant, however, I want to be able to change the series value data range based on the value of 2 cells.

    So, at the moment, I have 2 cells, in this case K1 + K2. Both cells contain an IF statement that will spit out another cell reference (say H2 + H39) based on the condition met in the if statement.

    So I want to be able to take the value of these 2 cells and use them as the data range for the series data, so that when the condition in the IF statement changes, the series data will display a different range of data on the chart.

    And I'm stumped, I have no idea how to do it. I've got as far as trying - $K$1:$K$2, realising that clearly doesn't work and have tried scouring the internet for help with no such luck. So any help would be very appreciated :D

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

    Re: Using a cells value to define chart data range

    Probably a few ways to solve this. It is a little hard to follow your exact needs, but here are my general thoughts.

    Your graph should reference a set of cells. The reference is static, but values in the cells will change based upon your 'IF statements'.

    It appears your IF statements are determining a cell range and providing an address. Using the INDIRECT function with those offsets should allow you to use those addresses within your cells that are being graphed.
    Alternatively, since your IF statements are essentially finding the correct range, the OFFSET function may be able to help.

    Check out those functions and see if they can be used to solve your issue.
    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
    Registered User
    Join Date
    02-12-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Using a cells value to define chart data range

    Excellent, thanks Pauley.

    Turns out the INDIRECT function was the one that helped me in the end, all working as I hoped.

    Thanks for your help :D

+ 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. How to define range for a chart
    By GDM69 in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 03-22-2013, 03:59 PM
  2. Define chart range using indirect reference
    By Thomas in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-10-2006, 04:50 PM
  3. How to define a range based on first and last cells with data?
    By Dennis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2006, 09:50 AM
  4. Define a range of cells in VBA
    By Noemi in forum Excel General
    Replies: 2
    Last Post: 10-20-2005, 12:05 AM
  5. [SOLVED] Re-define a range in cells
    By Geoff in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2005, 06:05 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