+ Reply to Thread
Results 1 to 6 of 6

Named Range for chart data using ROW and INDIRECT

  1. #1
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Named Range for chart data using ROW and INDIRECT

    Hi All,

    I am in the process of creating a sheet that has a dynamic chart by using a named range for the data source.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I can use the named range "data" in formulas and as the data source for a chart.

    I would like to generate a range of integers to use as axis labels. For this particular application, the labels should be integers, starting at 2. To this end, I created a named range like so;

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I can use the named range"xAxis_Labels" in formulas successfully, but when I try and use it to label a set of data, or as a data source in a chart, I get the error:

    A formula in this worksheet contains one or more invalid references......

    Any ideas?
    Attached Files Attached Files
    Last edited by sweep; 11-24-2017 at 07:15 AM.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Named Range for chart data using ROW and INDIRECT

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Re: Named Range for chart data using ROW and INDIRECT

    Sample uploaded..

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Named Range for chart data using ROW and INDIRECT

    Hi,

    You need to add the sheet name for context
    xAxis_Labels=ROW(INDIRECT("Sheet1!2:"&COUNT(Data)))
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Re: Named Range for chart data using ROW and INDIRECT

    Thanks Don, that's fixed it.

    Odd that the sheet name isn't required in the spreadsheet formulas - you live and learn!


    Just for the sake of robustness, I've created a named range for the sheet name:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and then used that in the other named range:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    so that if I change the name of the sheet at any point it won't fall over..

    Thanks again for your help.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Named Range for chart data using ROW and INDIRECT

    In a worksheet, the context is inherently that sheet unless otherwise specified. A chart is effectively its own type of sheet- even if it has been embedded in a worksheet- that has no concept of rows or columns, so you have to tie any range to a specific worksheet.

+ 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. Replies: 5
    Last Post: 07-29-2015, 08:36 AM
  2. Indirect function with Named Range for use as a PT Data Source
    By andikeep2580 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-20-2015, 12:07 PM
  3. Replies: 9
    Last Post: 04-01-2015, 04:23 PM
  4. Replies: 2
    Last Post: 06-03-2013, 08:26 AM
  5. Using INDIRECT to put a Dynamic Named Range in a chart Data Source
    By mgaworecki in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-01-2012, 07:35 AM
  6. [SOLVED] INDIRECT will not post Text string to Data Validation for Named Range on another Workbook
    By carleaston in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-15-2012, 05:08 PM
  7. Can I use named range in data range box when creating pie chart?
    By BJackson in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-17-2005, 01:05 PM

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