+ Reply to Thread
Results 1 to 8 of 8

Indirect function using a cell for a variable file/sheet name

  1. #1
    Registered User
    Join Date
    11-11-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Indirect function using a cell for a variable file/sheet name

    I have been on this for about an hour... My function is:
    =INDIRECT ("'["&$L2&".xls]"&$L2&"!E$1")

    The formula works in my initial cell. When I go to auto fill in the next column, I want the !E$1 part of the function move to F1, then G and so on. The problem is it's acting like an absolute value.

    I'm somewhat new to Excel, so I'm sure this is an easy fix.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Indirect function using a cell for a variable file/sheet name

    =INDIRECT("'["&$L2&".xls]"&$L2&"!"&E$1) mind you without setting up this its not tested
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    11-11-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Indirect function using a cell for a variable file/sheet name

    That gives me #REF! in the cell I placed it in

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Indirect function using a cell for a variable file/sheet name

    i cant get your original to work either!
    ok edit i can
    =INDIRECT("'["&$L2&".xls]"&$L2&"'!E$1")
    try
    =INDIRECT("'["&$L2&".xls]"&$L2&"'!"&ADDRESS(1,COLUMN(E1),2))
    Last edited by martindwilson; 11-11-2010 at 08:35 PM.

  5. #5
    Registered User
    Join Date
    11-11-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Indirect function using a cell for a variable file/sheet name

    Well, the original works here. Perhaps you don't have the workbooks saved as they should be with the correct cells filled. The function actually works great, its auto-filling that is the problem. When I auto-fill a row below, the L2's move to L3's.. I guess that's why I'm so confused!

    Like I said, I am fairly new to excel and have been learning formulas and things like absolutes on the fly.. I figured surely that's where I was tripped up

  6. #6
    Registered User
    Join Date
    11-11-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Indirect function using a cell for a variable file/sheet name

    Perhaps I'm using the wrong formula? What I'm ultimately after is pulling values in from another workbook, and using the auto-fill feature. There will be hundreds of values so manually filling in will take a TON of time! I know both sheets need to be open, that isn't a problem.

    Is there a better way to go about this problem?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Indirect function using a cell for a variable file/sheet name

    see my last post that works ok, i just set it up and tried it
    if you want to fill down as well
    =INDIRECT("'["&$L$2&".xls]"&$L$2&"'!"&ADDRESS(ROW(A1),COLUMN(E1),2))
    ps your example was missing a '
    =INDIRECT("'["&$L2&".xls]"&$L2&"'!E$1")
    Last edited by martindwilson; 11-11-2010 at 08:41 PM.

  8. #8
    Registered User
    Join Date
    11-11-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Indirect function using a cell for a variable file/sheet name

    You are amazing! Thank you VERY much!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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