+ Reply to Thread
Results 1 to 5 of 5

Dynamic Named Range formula with Indirect and Index for Chart

  1. #1
    Registered User
    Join Date
    10-11-2021
    Location
    Anderson, SC
    MS-Off Ver
    365
    Posts
    2

    Dynamic Named Range formula with Indirect and Index for Chart

    I thought I was adept at Excel, but this problem has me at wits end... I want to use a Dynamic Named Range in a chart so that I can have a "Rolling 60-day" chart that updates as new data is entered. I have done this in the past without problem. This particular dataset has a lot of blanks. I want to find the last non-blank cell (cell has value) and then get that plus the previous 59 data points (blank or not). I think I have way over-complicated this, but I am so far into the weeds that I cannot see my way out. My named range formula is: "=OFFSET(INDIRECT(ADDRESS(MATCH(MAX(AShift!$D:$D)+1,AShift!$D:$D),4)),0,0,-60,1)". This formula works fine when I am on the "AShift" worksheet. However, when I try to use the Named Range in a chart I am getting errors. I think it may have something to do with the "INDIRECT" function and charts. I am open to any solution (I would like to avoid VBA if possible - I am the only one at work who really knows it) I just need a dynamic graph. I think there is a simple solution, but it is beyond me at the moment. Any help is greatly appreciated. I am attaching a pared down version of the file that show the problem and a few of the many things i have tried...

    Thanks!
    Attached Files Attached Files
    Last edited by wmfinn001; 10-13-2021 at 05:33 PM. Reason: solved

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

    Re: Dynamic Named Range formula with Indirect and Index for Chart

    daterange
    Please Login or Register  to view this content.
    LIne1_A

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,695

    Re: Dynamic Named Range formula with Indirect and Index for Chart

    I used this array formula in the Refers To box for the named range Line1_A:

    =INDEX(AShift!$D:$D,MAX(IF(AShift!$D$5:$D$189<>"",ROW(AShift!$D$5:$D$189)))-60):INDEX(AShift!$D:$D,MAX(IF(AShift!$D$5:$D$189<>"",ROW(AShift!$D$5:$D$189))))

    This uses INDEX twice to define the start_cell and end_cell of the range, and I suppose you could use MAXIFS instead of MAX(IF( ...

    Anyway, you can then use this formula in cell L5 of the Chart sheet:

    =INDEX(LIne1_A,ROWS($1:1))

    and copy it down 60 rows to check on the values that it encompasses.

    There has always been a problem when two volatile functions (OFFSET and INDIRECT) are used in conjunction with one another.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    10-11-2021
    Location
    Anderson, SC
    MS-Off Ver
    365
    Posts
    2

    Re: Dynamic Named Range formula with Indirect and Index for Chart

    SOLVED! Thank you both for the fast reply! Pete_UK, thanks for the education on using two volatile functions together - it worked fine in the formula, but I guess Charts don't play nicely with that. I am going to use protonLeah's suggestion so I don't have to repeat the data on the Chart sheet. pL, an you explain how you used the 9E+303 in the Match function? How did that get the correct row?

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

    Re: Dynamic Named Range formula with Indirect and Index for Chart

    When using the MATCH function, match type 1 (or omitted) is the default; thus, MATCH finds the largest value that is less than or equal to lookup_value. 9e303 is just a very big number

+ 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. [SOLVED] Alternative to INDIRECT with dynamic named range
    By gak67 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-12-2020, 04:38 PM
  2. Index Match with Indirect and Named Range
    By hikari8 in forum Excel Formulas & Functions
    Replies: 44
    Last Post: 01-31-2020, 07:50 AM
  3. [SOLVED] INDIRECT formula in chart for dynamic range
    By rpinxt in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-14-2020, 09:41 AM
  4. [SOLVED] INDIRECT cannot be used in a dynamic named range OFFSET
    By BNCOXUK in forum Excel General
    Replies: 18
    Last Post: 09-19-2019, 09:48 AM
  5. Replies: 0
    Last Post: 03-08-2016, 02:25 PM
  6. Replies: 9
    Last Post: 04-01-2015, 04:23 PM
  7. 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

Tags for this Thread

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