+ Reply to Thread
Results 1 to 13 of 13

relative names as source data

  1. #1
    Registered User
    Join Date
    06-21-2007
    Posts
    25

    relative names as source data

    Is there a way to use a relative named range as the source data for a series on a chart?

    For example, if the name 'A' is defined as =indirect(sheet1!A1) and I type 'B' in cell A1 (and B is the name of a valid one-dimensional range), it seems like in-cell formulas will treat 'A' and 'B' the same, e.g.

    =max(A)

    and

    =max(B)

    return the same result. However, it seems like I can reference B as the source data for a series on a chart, but not A. Why wouldn't this work?

    thanks,
    peter

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485
    Charts using named ranges will not work from the result of the INDIRECT function.

    It may be simpler to set up some helper cells that display the required values based on formula and the named range remains static.

  3. #3
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Is this what you mean? Change the letter in cell A1 to B or D.
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485
    I should have been more specific.

    Charts using named ranges will not work from the result of the INDIRECT function used in conjunction with the OFFSET function.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by Andy Pope
    I should have been more specific.

    Charts using named ranges will not work from the result of the INDIRECT function used in conjunction with the OFFSET function.
    .

    Hi Andy Pope

    The Indirect and OFFSET function works for me. Here is an example how I'm using it. Just copy the chart to each worksheet then hit F9 or double click in any cell.
    Attached Files Attached Files

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485
    In your Chart.xls example change the named range B to

    =OFFSET(Sheet1!$B$2,0,0,8,1)

  7. #7
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by Andy Pope
    In your Chart.xls example change the named range B to

    =OFFSET(Sheet1!$B$2,0,0,8,1)

    It will still work but we need to be creative with the formulas. Here is an example below.
    Attached Files Attached Files

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485
    Yes looks like you can use INDIRECT and OFFSET that way

  9. #9
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by Andy Pope
    Yes looks like you can use INDIRECT and OFFSET that way
    Hi Andy Pope,


    Just curious did look at the second file I posted? If so I would like to get your opion on that.
    Last edited by vane0326; 05-13-2008 at 09:41 AM.

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485
    It's fine only the named ranges B and D have static range references.
    It's when you change those two to be OFFSET formula that the problems arise.

  11. #11
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by Andy Pope
    It's fine only the named ranges B and D have static range references.
    It's when you change those two to be OFFSET formula that the problems arise.

    I mean then second file I attach to this thread. It shows you could only have one Define name range for multiple charts. What do you take on that?

    The reason I'm asking you because you have alot experience on charts and I seen your name on various forums.

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485
    That approachs would work well if all the chartable data was in the same location on multiple sheets.

    One thing to be aware of. The CELL function is not stable when a reference is not used as the second argument.

    =MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

    This means all the charts on each sheet will be based on the same data set.

    Try this, create a New Window and arrange Horizontally.
    Show both Sheet1 and Sheet2 and then press F9. Then switch to the other view and press F9 again. You should see that both charts are running of the same data.

  13. #13
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by Andy Pope
    That approachs would work well if all the chartable data was in the same location on multiple sheets.

    One thing to be aware of. The CELL function is not stable when a reference is not used as the second argument.

    =MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

    This means all the charts on each sheet will be based on the same data set.

    Try this, create a New Window and arrange Horizontally.
    Show both Sheet1 and Sheet2 and then press F9. Then switch to the other view and press F9 again. You should see that both charts are running of the same data.
    Nice I never knew that.


    Thanks Andy Pope!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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