+ Reply to Thread
Results 1 to 9 of 9

Dynamic reference to named formula returns #REF

  1. #1
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Dynamic reference to named formula returns #REF

    I’m trying to use a dynamic reference to named formulas. Each formula has a Name ending with a number ATEST1, ATEST2 etc. I am referring to the named formulas using the indirect function.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    However, when I do I get a #REF error.

    Things I have tried;
    Building a dynamic reference to a name returns valid results If the name is not a formula and just refers to a cell.

    Building the dynamic reference to the name formula returns #REF.

    Referring directly to the named formula returns a valid result.

    I have simplified and duplicated this problem in the attached workbook.

    If there is a way to pull this off please enlighten me.
    Thanks
    Robert
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Dynamic reference to named formula returns #REF

    From Help:

    The INDIRECT function syntax has the following arguments:

    Ref_text Required. A reference to a cell that contains an A1-style reference, an R1C1-style reference, a name defined as a reference, or a reference to a cell as a text string. If ref_text is not a valid cell reference, INDIRECT returns the #REF! error value.
    The word "cell" could more accurately be replaced by "range," but a named formula is not among the possibilities.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Dynamic reference to named formula returns #REF

    Indirect does not work with dynamic ranges, because it sees argument as a string. Otherwise a dynamic range must be evaluated.
    What do you want to achieve?

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

    Re: Dynamic reference to named formula returns #REF

    It looks like what you need is a user defined function that takes column A values as input. Then a case statement in the UDF can run the appropriate formulas.
    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.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Dynamic reference to named formula returns #REF

    Or a CHOOSE formula.

  6. #6
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163
    Quote Originally Posted by dflak View Post
    It looks like what you need is a user defined function that takes column A values as input. Then a case statement in the UDF can run the appropriate formulas.
    Thanks, i will look into that!

  7. #7
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163
    Quote Originally Posted by shg View Post
    Or a CHOOSE formula.
    I dont undetstand what you mean. Can you explain please?

    Oh wait, perhaps you are pointing me to the CHOOSE function! I'm a little slow but I catch on eventually :D
    Last edited by Hammer_757; 04-25-2018 at 11:06 AM. Reason: I saw the light! maybe

  8. #8
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163
    Quote Originally Posted by shg View Post
    From Help:



    The word "cell" could more accurately be replaced by "range," but a named formula is not among the possibilities.
    Thanks for clearifying that!

  9. #9
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Dynamic reference to named formula returns #REF

    Thanks all, I was able to get what I needed using the CHOOSE function as hinted by shg.
    I use
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This is named SiteRngChu and in the other formulas that need one of the SiteRng# I inserted SiteRngChu making the other formulas a little less bloated.

+ 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] Named Formula returns #value error
    By Hammer_757 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-10-2018, 01:57 PM
  2. Named Formula returns #value error
    By Hammer_757 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-09-2018, 03:41 PM
  3. Named ranged with reference to second row in dynamic table
    By jaryszek in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-04-2018, 05:18 AM
  4. [SOLVED] Named range and reference to one cell within dynamic table
    By jaryszek in forum Excel General
    Replies: 9
    Last Post: 03-22-2018, 07:04 AM
  5. Replies: 0
    Last Post: 03-08-2016, 02:25 PM
  6. Dynamic Named Range + Index/Match Returning Circular Reference
    By jennarenae in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2014, 06:23 PM
  7. How to dynamically reference a dynamic named range
    By paris3 in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 09-06-2005, 12: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