+ Reply to Thread
Results 1 to 6 of 6

Dynamic Named Range for Graph Not Working

  1. #1
    Registered User
    Join Date
    04-15-2015
    Location
    Nanaimo, BC
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Dynamic Named Range for Graph Not Working

    Hi,

    I am pulling my hair out on this one.

    I have a graph in Excel and I want it to update based on two cells I have for the Start Date and End Date.

    I am using a Named Range for the Axix label range, but get an error when trying to use it ("There's an error in the formula you entered.")

    The formula I am using in the Named Range is:

    =OFFSET(INDIRECT("A"&MATCH('Trigger Log'!$N$1008, 'Trigger Log'!$A$1:$A$9999,0)),0,0,COUNTA(INDIRECT("A"&MATCH('Trigger Log'!$N$1008,'Trigger Log'!$A$1:$A$9999,0)&":$A9999")))

    ...where N1008 is the cell of my Date Start. The formula seems to resolve properly into a range, but I can't seem to get it to work. I'd paste the steps here, but Excel doesn't allow me to copy from the Evaluate Formula dialog!

    I was previously using: "=OFFSET('Trigger Log'!$A$2,0,0,COUNTA('Trigger Log'!$A:$A)-1)" which works, but I really want to be able to be able to quickly choose the start and end dates for my graph...

    Any help would greatly be appreciated.

    I've attached a modified version of my Excel file here (I removed personal details since this is for a personal medical log). You will get an error due to it not liking my Named Range: "GraphDateDynamic" -- the graph is at the bottom of the data and is currently using a deleted Named Range since it won't accept "GraphDateDynamic".
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,918

    Re: Dynamic Named Range for Graph Not Working

    Please Login or Register  to view this content.
    StartDate='Trigger Log'!$N$1008
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    04-15-2015
    Location
    Nanaimo, BC
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Dynamic Named Range for Graph Not Working

    Thanks protonLeah - I will try your solution in a bit as it's always good to learn new things.

    I modified my old formula a bit (with the help of somebody in another forum) to include the end date range too, and got it working:

    =OFFSET('Trigger Log'!$A$1,MATCH('Trigger Log'!$N$1008,'Trigger Log'!$A:$A,0)-1,,MATCH('Trigger Log'!$O$1008,'Trigger Log'!$A:$A,0)-(MATCH('Trigger Log'!$N$1008,'Trigger Log'!$A:$A,0)-1))

    I then created another Named Range for the series (the same formula as above, but just adding an 8 where the Cols parameter goes - simple!).

    I guess that OFFSET won't take INDIRECT, or INDIRECT won't work with dynamic ranges or something? I'm not sure why my original formula didn't work... it evaluated fine...

  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: Dynamic Named Range for Graph Not Working

    Hi,

    The problem was just that you didn't include a sheet name in the INDIRECT formula- you needed
    =OFFSET(INDIRECT("'Trigger Log'!A"&MATCH('Trigger Log'!$N$1008, 'Trigger Log'!$A$1:$A$9999,0)),0,0,COUNTA(INDIRECT("'Trigger Log'!A"&MATCH('Trigger Log'!$N$1008,'Trigger Log'!$A$1:$A$9999,0)&":$A9999")))
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Registered User
    Join Date
    04-15-2015
    Location
    Nanaimo, BC
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Dynamic Named Range for Graph Not Working

    Quote Originally Posted by xlnitwit View Post
    Hi,

    The problem was just that you didn't include a sheet name in the INDIRECT formula- you needed
    =OFFSET(INDIRECT("'Trigger Log'!A"&MATCH('Trigger Log'!$N$1008, 'Trigger Log'!$A$1:$A$9999,0)),0,0,COUNTA(INDIRECT("'Trigger Log'!A"&MATCH('Trigger Log'!$N$1008,'Trigger Log'!$A$1:$A$9999,0)&":$A9999")))
    Thanks! I guess it was a question of scope then, as my original Named Range had a scope of Workbook. When I tried setting the scope to the sheet, then it worked. Aha! Thanks again.

  6. #6
    Registered User
    Join Date
    04-15-2015
    Location
    Nanaimo, BC
    MS-Off Ver
    Microsoft Office Professional Plus 2010
    Posts
    8

    Re: Dynamic Named Range for Graph Not Working

    And protonleah, thanks for your solution. It works and is a nice alternative!

+ 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: 0
    Last Post: 03-08-2016, 02:25 PM
  2. [SOLVED] Dynamic Named Range not working as expected
    By Leonthefixer in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-03-2015, 07:42 AM
  3. [SOLVED] Creating a Graph Using Dynamic Named Ranges
    By JasonMcQueen in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-03-2014, 10:23 AM
  4. How to add a named range of dynamic data to a graph
    By mashoutposse in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-31-2010, 08:57 PM
  5. Named ranges-Should I use a dynamic named range
    By foseco in forum Excel General
    Replies: 4
    Last Post: 06-11-2009, 03:56 PM
  6. Dynamic Range with unused formula messing up x axis on dynamic graph
    By cabybake@yahoo.com in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-02-2006, 04:10 PM
  7. Replies: 6
    Last Post: 01-25-2006, 02:45 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