+ Reply to Thread
Results 1 to 5 of 5

Too many instances of "INDIRECT"?

Hybrid View

  1. #1
    Registered User
    Join Date
    04-04-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Too many instances of "INDIRECT"?

    Hi folks!

    Well, I only dabble with Excel occasionally, but whenever I do, boy, do things get ambitious. Now I've run into a bit of a brick wall trying to reference one worksheet from another, with the specific worksheet referenced being variable (it looks for the worksheet name in cell D3).

    I formerly had this, the "hard-coded" version:

    =SUM('2009'!F4:OFFSET('2009'!F4,(MATCH(B3,'2009'!A4:A15,0)-1),0,1,1))

    I want to replace "2009" with the lovely and helpful INDIRECT function, and have managed to get to this point:

    =SUM('2009'!F7:OFFSET(INDIRECT(D3&"!F7"),(MATCH(B3,INDIRECT(D3&"!A7:A18"),0)-1),0,1,1))

    However, I can't for the life of me get rid of that first reference to "2009" by replacing it with a third "INDIRECT" function. I'm sure I'm putting the brackets and quotes in the right place but i always get an error.

    Here's what I'm trying:

    =SUM(INDIRECT(D3&"!F7:OFFSET(INDIRECT(D3&"!F7"),(MATCH(B3,INDIRECT(D3&"!A7:A18"),0)-1),0,1,1)"))

    Am I just missing something incredibly obvious?

    Any help is much appreciated... thanks!

    Adam
    Last edited by cosmocanuck; 04-04-2009 at 02:49 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Too many instances of "INDIRECT"?

    You have to close off the end of the first INDIRECT you're trying to add, just like you did for the other two, I believe right after the F7 reference.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-04-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Too many instances of "INDIRECT"?

    Thank you!!! I don't know why I thought that first one had to be treated differently. It works perfectly now!

    adam

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Too many instances of "INDIRECT"?

    Great! If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

  5. #5
    Registered User
    Join Date
    04-04-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Too many instances of "INDIRECT"?

    Done! Thanks again!

+ 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