+ Reply to Thread
Results 1 to 7 of 7

Nested Indirects

  1. #1
    Registered User
    Join Date
    04-18-2019
    Location
    Oregon, USA
    MS-Off Ver
    Office 365
    Posts
    13

    Nested Indirects

    I have this formula in a sheet:

    =IF($A8<>"",SUMPRODUCT(COUNTIF(INDIRECT("'"&$K$10:$K$33&"'!"&CELL("address",$B9)),B$3)),"")

    where K10 thru Knn contains a list of the sheet names in the workbook. The number of sheets is variable, so I have calculated the last row with a valid sheet name in cell L58.

    I want to replace the 33 in the reference $K$33 with the value in L58. I think I can do this with another INDIRECT, or possibly an OFFSET, but in either case I can't figure out the exact syntax. Help would be much appreciated, as I'm now so frustrated I'm about to throw something at my monitor.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Nested Indirects

    Isn't it just as simple as

    =IF($A8<>"",SUMPRODUCT(COUNTIF(INDIRECT("'"&INDIRECT("$K$10:$K$"&L8)&"'!"&CELL("address",$B9)),B$3)),"")

  3. #3
    Registered User
    Join Date
    04-18-2019
    Location
    Oregon, USA
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Nested Indirects

    Not quite, though that's probably closer than I've come. Your version throws a #REF error. I think the problem is (at least one) missing quote somewhere between L8 and "'!, but I can't quite wrap my head around it yet. I'm playing with it now, though.

  4. #4
    Registered User
    Join Date
    04-18-2019
    Location
    Oregon, USA
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Nested Indirects

    Ah, got it. The reference needed to be to L58, you typed L8, and I simply used that. Thanks very much!!!!!

  5. #5
    Registered User
    Join Date
    04-18-2019
    Location
    Oregon, USA
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Nested Indirects

    To be very precise about it, the completely correct version is:

    =IF($A8<>"",SUMPRODUCT(COUNTIF(INDIRECT("'"&INDIRECT("$K$10:$K$"&$L$58)&"'!"&CELL("address",$B9)),B$3)),"")

    The $ around the cell containing the last row of the list of sheets (i.e, $L$58 vs L58) are important - at least to me, as I'm copying this formula to multiple columns and rows, and that reference needs to stay static.

  6. #6
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Nested Indirects

    Quote Originally Posted by Kay9835 View Post
    Ah, got it. The reference needed to be to L58, you typed L8, and I simply used that. Thanks very much!!!!!
    Sorry, that was me testing, I changed to L8 so it would be on the same window of the screen.

  7. #7
    Registered User
    Join Date
    04-18-2019
    Location
    Oregon, USA
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Nested Indirects

    No worries. It took only a moment to find that - once I stopped obsessing about where the quotes should go.

+ 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. Is there a formula to be able to have multiple indirects and pick lists?
    By simplyrose in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-27-2019, 11:21 AM
  2. [SOLVED] SUMPRODUCT & INDIRECTS slowing the sheet down?
    By CraigMcKee in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-28-2018, 05:37 AM
  3. Countifs and Indirects and get them to mix
    By swifty1234 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-06-2015, 12:16 AM
  4. [SOLVED] INDEX MATCH with INDIRECTs
    By cpyter in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-12-2015, 11:18 AM
  5. SUMIFS w/ INDIRECTS?
    By HCBalelo in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-19-2012, 08:51 AM
  6. Retreiving Data using AVERAGE and INDIRECTS?
    By crucial in forum Excel General
    Replies: 8
    Last Post: 04-17-2008, 07:47 AM
  7. Best way to count indirects of indirects
    By vsynowiec in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-20-2008, 06:50 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