Dynamic Range

bobkap

Active Member
Joined
Nov 22, 2009
Messages
313
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
I have 2 named ranges - bk and bkt - that I wanted to make dynamic. I thought I correctly created them but when I did everything went haywire. Link to the file is below.

As you will see, it seemed to compute everything correctly except in cells D14,15; E14, 15; F14, F15. I just cannot seem to figure out why it will work in some cells but not others.

Any much needed help would be greatly appreciated.


 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
What should each one refer to if they were not dynamic? (based on the current data).

bk definitely contains an error, bkt looks ok but may not be depending on requirements.
 
Upvote 0
Thanks for asking! Disregarding being a dynamic range, I'd just like my "data" sheet data to all be in one named range.

Really appreciate the help! Curious as to what the error is in bk.
 
Upvote 0
Curious as to what the error is in bk.
You had COUNTA(A1048575) instead of COUNTA(A:A) so it was trying to count a single empty cell at the bottom of the sheet instead of the actual data.

If yo want to make the data table truly dynamic (without making it volatile by using OFFSET) then I would go with the following method.

LastCol =MATCH(1e+100,Data!$1:$1)
LastRow =MATCH("zzz",Data!$A:$A)
bkt =Data!$B$1:INDEX(Data!$1:$1,LastCol)
bks =Data!$A$2:INDEX(Data!$A:$A,LastRow)
bk =Data!$B$2:INDEX(Data!$B:$B,LastRow):INDEX(Data!$2:$2,LastCol)

Using those definitions, bkt will give you the data in Row 1, bks will give you the data in Column A, bk will give you the rest of the table (excluding row 1 and column A).

Note that there is some clutter in column A starting from A36, it would be best to move this in order to make the dynamic ranges work properly. Dragging them to the right a bit will be fine, as long as there is no clutter in column A or row 1 it will work correctly.
 
Upvote 0
Mega thanks again!!! I love your solution of using several names too.
 
Upvote 0
You had COUNTA(A1048575) instead of COUNTA(A:A) so it was trying to count a single empty cell at the bottom of the sheet instead of the actual data.

If yo want to make the data table truly dynamic (without making it volatile by using OFFSET) then I would go with the following method.

LastCol =MATCH(1e+100,Data!$1:$1)
LastRow =MATCH("zzz",Data!$A:$A)
bkt =Data!$B$1:INDEX(Data!$1:$1,LastCol)
bks =Data!$A$2:INDEX(Data!$A:$A,LastRow)
bk =Data!$B$2:INDEX(Data!$B:$B,LastRow):INDEX(Data!$2:$2,LastCol)

Using those definitions, bkt will give you the data in Row 1, bks will give you the data in Column A, bk will give you the rest of the table (excluding row 1 and column A).

Note that there is some clutter in column A starting from A36, it would be best to move this in order to make the dynamic ranges work properly. Dragging them to the right a bit will be fine, as long as there is no clutter in column A or row 1 it will work correctly.
I don't mean to be a pest or appear ungrateful, but would you mind telling me what the "1e+100" does as well as the "zzz"? I can get the LastCol to work but the LastRow does not.
 
Upvote 0
1E+100 finds the last numeric entry in a row / column.
"zzz" should find the last text entry (on the assumption that you don't have text entries that start with "zzz" in your actual data.

You do need to use the correct one for the type of data that you have, 1E+100 will not see any text in the row / column that it looks at, likewise "zzz" will not see numeric data.

There were also some odd entries lower down the sheet, the last row formula will still work with them there but will include them in the range along with any empty rows between them and the proper table.
 
Upvote 0
Solution
Thanks again. Now that I've named my ranges via defining the name process vs just highlighting and naming in that dropdown field just above the A1 cell, the names no longer appear in the drop down. Is there any way that I can see what cells my named range is covering now?
 
Upvote 0
Possibly you're still using the old name?
You would need to use =bkt to return the numbers in row 1 to the dropdown and =bks to return the text in column A.

If you type bk, bkt, or bks into the that normally shows the address of the active cell (to the left of the formula bar) it should take you to that range and automatically select it.
 
Upvote 0

Forum statistics

Threads
1,215,361
Messages
6,124,497
Members
449,166
Latest member
hokjock

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