+ Reply to Thread
Results 1 to 6 of 6

Removing #REF! indirect index function

  1. #1
    Registered User
    Join Date
    03-28-2011
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2003
    Posts
    9

    Removing #REF! indirect index function

    Hi,

    I'm looking to remove the #REF! result from this function. I'm aware that I might be able to use ISNA or Iserror but i cant seem to get it to work so far.

    This is my formula at the moment.

    =IF($A$20="","",INDEX(INDIRECT($A$20),ROW(A7)))

    Thanks


    Mark

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

    Re: Removing #REF! indirect index function

    What's in A20 and where does it come from?
    Since Row(A7)=7, what's the point of that?
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    03-28-2011
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Removing #REF! indirect index function

    thank you for your quick reply, i have attached the spreadsheet, if you choose between 'Narrow' and 'Antique' in cell A20 you can see the #REF! results shown. I know they are there because there is only one value in the named range 'Antique' but is there a way they can be removed?
    Attached Files Attached Files

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

    Re: Removing #REF! indirect index function

    A20 would have to be a formula that results in a cell address not a data value. That is, the INDIRECT function uses one cell as the pointer to another cell.

    Suppose you have the value 100 in cell K31 because of some math result and in C100 you have 13.

    Now suppose that you have, in cell, say D3: =INDIRECT("C" & K31) ---> The result in D3 is =INDIRECT(C100) which will display 13

    Since you have the word Antique in cell A20, you get the #Ref error, Antique not being a cell address...
    Last edited by protonLeah; 04-08-2011 at 02:31 AM.

  5. #5
    Registered User
    Join Date
    03-30-2011
    Location
    Coventry, UK
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Removing #REF! indirect index function

    My easy workaround for your case goes something like this:

    if(iserror(your formula)= true," ",your formula)

    you basically copy and paste "your formula" , whatever it is as logicla test and as reult when logical test is false. when it gives error, you choose to show whatever you want, when it's not error, it shows your normal formula result.
    so this line of thought works fine most of the times for me. I used " " (space character) so it becomes invisible for the user, but you could use 0 as well if the cell is involved in calculations. you may omit "=true" in the logical test.


    Quote Originally Posted by dyerdyerdyer View Post
    Hi,

    I'm looking to remove the #REF! result from this function. I'm aware that I might be able to use ISNA or Iserror but i cant seem to get it to work so far.

    This is my formula at the moment.

    =IF($A$20="","",INDEX(INDIRECT($A$20),ROW(A7)))

    Thanks


    Mark

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Removing #REF! indirect index function

    Quote Originally Posted by dyerdyerdyer
    if you choose between 'Narrow' and 'Antique' in cell A20 you can see the #REF! results shown. I know they are there because there is only one value in the named range 'Antique' but is there a way they can be removed?

    The issue in this instance is that the Named Range being evaluated has fewer rows than being referenced - ie Antique refers only to one row.
    Above is 100% accurate - there are a few approaches you could adopt to handle the errors:

    a) double evaluate the formula in it's entirety along the lines outlined in prior post (note use of =TRUE is superfluous):

    Please Login or Register  to view this content.
    b) double evaluate the INDIRECT element only (ie validate rows)

    Please Login or Register  to view this content.
    c) if you know the result is always text you can avoid the double evaluation via a LOOKUP & CHOOSE construct

    Please Login or Register  to view this content.
    For the remaining calculations in Col C I would use either

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    If you want to display 0 for the missing items use the latter item and remove the pre-emptive IF


    One final pointer...

    If your source Defined Names are ever to become Dynamic then INDIRECT will cease to work in the above form
    (in other words were "Antique" defined using OFFSET or INDEX construct rather than a hard wired range (such that it resized itself automatically) a basic INDIRECT approach will no longer suffice)

+ 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