+ Reply to Thread
Results 1 to 4 of 4

Can't get Indirect range to autofill

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Oklahoma
    MS-Off Ver
    Excel 2010
    Posts
    2

    Exclamation Can't get Indirect range to autofill

    I am working on a spreadsheet that tracks backorders monthly. The workbook has 13 sheets - one for each month and a graph sheet that utilizes a drop down box to select the month of data to display in the graph. The drop down box is the reason for the INDIRECT function. Rather than reference a sheet directly within all the forumlas, the sheet names are all in the drop down and I indirectly reference the cell with the drop downs ($A$19).

    Now the issue I have is within a COUNTIF formula, I indirectly reference a incremental range, but I cannot get the formula to autofill correctly. The range references remain absolute. Here is the formula that I need help with (I made the problem area bold):

    =IF(COUNTIF(INDIRECT($A$19&"!M2:$M$1048576"),INDIRECT("'"&$A$19&"'"&CELL("address",M2)))=1,INDIRECT("'"&$A$19&"'!"&CELL("address",M51)),"")

    The M2's in the formula above should all incrementally increase (M3, M4, etc) when I autofill. The CELL references autofill fine, but the M2 in the range does not.

    I looked all over the web and was not able to figure this one out. Thanks in advance for your help!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Can't get Indirect range to autofill

    I assume you mean this M2
    =IF(COUNTIF(INDIRECT($A$19&"!M2:$M$1048576"),INDIRECT("'"&$A$19&"'"&CELL("address",M2)))=1,INDIRECT("'"&$A$19&"'!"&CELL("address",M51)),"")

    That's part of a text string "!M2:$M$1048576", this is why it's not incrimenting.

    You need to apply the Cell("Address",M2) function to that part as well

    =IF(COUNTIF(INDIRECT($A$19&"!"&CELL("Address",M2)&":$M$1048576"),INDIRECT("'"&$A$19&"'"&CELL("address",M2)))=1,INDIRECT("'"&$A$19&"'!"&CELL("address",M51)),"")

  3. #3
    Registered User
    Join Date
    05-07-2013
    Location
    Oklahoma
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Can't get Indirect range to autofill

    That works perfectly! Thank you so much! I assumed it was something like that, but for the life of me I could not get that range to work with the CELL("address") command. I was trying to put the $M$1048576 in the parentheses and it would just give me errors. I am still trying to get used to placement of all the quotation marks and parentheses.

    Thanks again!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Can't get Indirect range to autofill

    Glad to help...

    Just notice that the function is called cell, not cellS

+ 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