I'm trying to create dynamic name ranges using data presented in a pivot table. See below:
I would like to create a dynamic name range that captures this data. Here is what I wrote:
=OFFSET(INDIRECT(CONCATENATE("'R1'!",(CELL("address",INDEX('R1'!$A:$A,MATCH(MIN('R1'!$A:$A),'R1'!$A:$A,0)))))),0,0,COUNTIF('R1'!$A:$A,">1/1/2006"))
The first argument of this offset formula is multi-part: I had to first find the first date in column A using INDEX('R1'!$A:$A,MATCH(MIN('R1'!$A:$A)
, then find the address of that cell, then present it properly for the offset formula using concatenate (to append the sheet name) and indirect.
For the height of this name range, I used a COUNTIF
function to get the amount of dates in the column.
However, when I assign that formula to a name range and tested it in a pivot table, I get the error "Reference isn't valid". Any ideas?