Dynamic Name Range

dsandoz116

Board Regular
Joined
Jun 21, 2013
Messages
68
I have a summary workbook that is referencing 20 other workbooks, and each workbook is then recalling the data on individual worksheets. Thus, I have 20 worksheets that I would like to then create individual pivot tables to summarize each worksheet, and have all pivot tables on one worksheet. Problem is, the data is updated daily, and when I try to create a dynamic name range I get the error "Data source reference is not valid." I have checked multiple times, and cannot find the error. Can someone help me? Here is the formula I am using for one of my sheets, the only one I have been working on since I can't get anything to work :( I have tried creating the pivot table without doing dynamic name range and only selecting the cells with data, the pivot table forms perfectly and I am able to group my dates as needed.

When I go to Name Manager-->New, I change the scope to be the specific worksheet I am referencing. There will never be more than 1000 rows of data, by year end it will be about 800 I think or so. There are also 42 columns, and all of these are formatted the same on each worksheet.

=OFFSET('ABC-1'!$A$6,,,COUNT('ABC-1'!$A$6:$AO$1000),42)+'ABC-1'!$A$3

I appreciate your help!

Dsandoz116
 
Is column A a formula? If yes, what is that formula?

FYI, formulas that return "" are NOT blank, and will be counted as Not Blank
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Yes Column A is a formula.

=IF('P:\ABC\[ABC-1.xlsx]ABC-1'!A6="","",'P:\ABC\[ABC-1.xlsx]ABC-1'!A6)

This is referencing the region specific workbook.
 
Upvote 0
I would put a formula in the book to do the counta based on the column that formula refers to..
Assuming THAT column is actually hard coded values, and not blanks.

Say Z1 in your book
=COUNTA('P:\ABC\[ABC-1.xlsx]ABC-1'!A:A)

Then in your named range, replace the counta function with $Z$1



Or is there any other column in your book that does not contain formulas and can be used to determine the # of rows in the named range?
 
Upvote 0
I put the counta formula in cell A3 in the worksheet in my summary workbook. There are over 200 rows of data and when I hit enter a value of "3" results in the cell I entered the formula. I really apologize for having you step me through this, but it is really appreciated.

Ok, so I put the formula in A3 and the "3" resulted, then I replaced the named range with $A$3. When I check to see what cells are being referenced, only three rows are highlighted, corresponding to the "3" I presume. I feel like we are so close! THANK YOU THANK YOU for helping meee!

This is what is in my named range:

=OFFSET('ABC-1'!$A$5,,,'ABC-1'!$A$3,41)


FOUND ERROR.....Here is what I edited to put in A3, my overlook.....=COUNTA('P:\ABC\[ABC-1.xlsx]ABC-1'!A:A)

Now 206 results and not 3.


Still same error is resulting even though I am getting the 206 in the cell. So frustrating, but progress is being made.
 
Last edited:
Upvote 0
You did it correctly.

If =COUNTA('P:\ABC\[ABC-1.xlsx]ABC-1'!A:A) returns 3, then it means there are only 3 non blank cells in that column.


Forget about the other book for now.
In the book your working on, is there ANY other column that contains normal hard coded values (not formulas) that can be used instead of A ?
 
Upvote 0
Gives me a formula contains error. What if I insert a column that looks at the former column A (now B), and returns its value. Then I could count the nonblank cells this way. Tried this alternative method as well and get 995 in the cell instead of 206.

Dsandoz116
 
Upvote 0
The basic problem is that formulas are NOT blank, even a formula that returns ""
So the counta Function includes those cells in it's count.

Hmm, did not know this but apparently you need ' around a sheet name containing a hyphen.
I knew it was true for spaces in the sheetname, but never knew about hyphens..
Learn something new every day.

Should be
=OFFSET('ABC-1'!$A$5,,,COUNTIF('ABC-1'!$A$5:$A$1000,"?*"),42)
 
Upvote 0
Formula error went away. It is referencing exactly the non blank cells. All looks good until I go to the pivot table sheet and insert a pivot table. I insert N (what I named the range) for range and click on a cell where I want the pivot table. I get data source reference is not valid error.
 
Upvote 0

Forum statistics

Threads
1,215,456
Messages
6,124,939
Members
449,197
Latest member
k_bs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top