Dynamic Range

aka_krakur

Active Member
Joined
Jan 31, 2006
Messages
438
I am having difficulty creating a dynamic named range based off of a offset formula. The data on the worksheet changes based off a query refresh and I need the named ranges to change accordingly. I had someone help me write this formula :
defined name "dataul" refers to: =$W$25
defined name "data" refers to: =offset(dataul,0,0,counta($W:$W),1)

Okay, so I did a refresh on the data and the last row of data was 2055.
I looked at the defined name range for "data" and it went down to 2058 (which contains 3 rows of no data).
This messes up a formula I have because the formula doesn't like blanks. Unless someone can help me re-write the formula to search even blank data--not sure if it can be done.

Here's the formula with the dynamic named ranges in it:
Code:
=(SUMPRODUCT(--(MMULT(--ISNUMBER(SEARCH(ChartData!$B$4:$E$4,'TEMPLATEProductFamily-ReportedCode-Test.xls'!data))+0,ROW(ReportableQuery!$W$25:INDEX('TEMPLATEProductFamily-ReportedCode-Test.xls'!data,COLUMNS(ChartData!$B$4:$E$4)))^0)>0),--(MMULT(--ISNUMBER(SEARCH(ChartData!$A$4,'TEMPLATEProductFamily-ReportedCode-Test.xls'!pf_data))+0,ROW(ReportableQuery!$L$25:INDEX('TEMPLATEProductFamily-ReportedCode-Test.xls'!pf_data,COLUMNS(ChartData!$A$4)))^0)>0),--('TEMPLATEProductFamily-ReportedCode-Test.xls'!date_data-DAY('TEMPLATEProductFamily-ReportedCode-Test.xls'!date_data)+1=ChartData!B$7)))
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi Aka_Krakur

Are you sure that the cells above W25 are genuinely blank? Note that formulas that result in "" (for the sake of argument ="") will be included in the Counta.

Best regards

Richard
 
Upvote 0
I think I might have solved the problem. I changed the offset formula to be more specific.
it now reads:
=offset(dataul,0,0,counta($W$25:$W$65536),1)
And it works.
I think what you said about above W25 was exactly the problem. I was only looking to make W25 through whatever the last cell below had data the range.
So by forcing the range $W$25:$W$65536, it works. I do have information above W25 but it doesn't ever change; but it's not included in this range.

Anyway, I'm going to keep testing it out with different scenarios to make sure it does work.
I'm still not sure why keeping it W:W doesn't work. but, oh well, we'll see how it goes
 
Upvote 0
I do have information above W25 but it doesn't ever change; but it's not included in this range.

This was exactly your problem as the counta returns a count of all cells containing text/formulas. I'm glad you've sorted it though!

Richard
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

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