+ Reply to Thread
Results 1 to 5 of 5

Using INDIRECT with named ranges

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    12

    Using INDIRECT with named ranges

    Hello all,

    I have a named range called List_To_Show, defined as =INDIRECT("List_"&List_Sel). List_Sel is either "1" or "2". The named ranges "List_1" and "List_2" are static.

    If I use List_To_Show in an INDEX function as follows, the function works: =INDEX(List_To_Show,2,2). However, if I try to use it in an index function in conjunction with INDIRECT, it fails: =INDEX(INDIRECT("List_"&"To_Show"),2,2). As far as I can tell, the two should produce exactly the same result. Can anyone explain why the second one fails?

    For reference, I have attached the spreadsheet I'm using. It needs to work in Excel 2003 and later versions. Thanks in advance for your help!


    BTW, I realize this issue may seem trivial. I created this simple example to illustrate a problem I'm having with a much more complicated spreadsheet.
    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,612

    Re: Using INDIRECT with named ranges

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

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Using INDIRECT with named ranges

    Please Login or Register  to view this content.
    List_To_Show is an tekst in which indirect can't find any value (since it is not related to any cell at all).

    See for the help function F1 for the explaining of the function indirect.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    05-31-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Using INDIRECT with named ranges

    Thank you both for the responses. Unfortunately, I haven't been able to solve this problem yet and would appreciate your continued advice.

    What I would like to do is build a particular named range as a text string (using the contents of certain cells) and have that particular named range refer to one of multiple other named ranges. I've attached a new spreadsheet with a more complicated example to try to illustrate the situation.

    In this new example, "List_Current" is a range that refers to either "List_Current_A" or "List_Current_B" and "List_Future" is a range that refers to either "List_Future_A" or "List_Future_B". The determination of A or B and the determination of Current or Future are made by referencing cells in the worksheet.

    The formulas highlighted in yellow illustrate what I would like to do. What I don't understand is why directly using the named range List_Current works (as done in cell L14) but using INDIRECT to reference "List_Current" does not work. Based on the Excel help and my own past experience, this seems exactly what INDIRECT is intended to do- return a reference specified by a text string.

    Any suggestions? If you have alternate approaches to tackling this I would enjoy hearing them as well. I would like to avoid building the text strings as "List_Current_A" and "List_Current_B" because my master spreadsheet was constructed to reference only "List_Current"- hence my desire to work with that name only rather than each of the possible names that it might refer to.

    Thanks!
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Using INDIRECT with named ranges

    With helpcells in E1:G1

    With a helpcolumn in column L

    See the attached file.

    m4 =INDEX(INDIRECT($L4),$K4,match($J4,$E$1:$G$1,0))

+ 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. Indirect Vlookup List and Dynamic Named Ranges - Is there a workaround
    By Jennasis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-13-2013, 06:57 AM
  2. Replies: 5
    Last Post: 06-03-2010, 01:04 PM
  3. INDIRECT and named ranges
    By Excel_Learner42 in forum Excel General
    Replies: 3
    Last Post: 01-02-2009, 01:18 PM
  4. Indirect with Named ranges - Control cell
    By danxt in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-23-2007, 11:40 AM
  5. INDIRECT and Named Ranges referencing closed workbook
    By gpie in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-06-2005, 07:05 PM

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