Dynamic named range

chewitt

New Member
Joined
Oct 5, 2004
Messages
18
Hello all,

I am needing help defining a dynamic named range. I am currently using this:

=OFFSET(Blank!$A$8,0,0,COUNTIF(Blank!$A:$A, ">=0"))

Isn't there a better method of counting the numeric values?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Dear chewitt,

if you want to count all numeric numbers in Column A (including negative numbers) please use below formula.

=COUNTIF(A:A,">=0")+COUNTIF(A:A,"<0")

Is it O.K?
 
Upvote 0
Thanks for your quick reply.

Yes that would work, but I was thinking there should be a better way to represent the criteria (similarly to ISNUMBER()). Quite simply, it does not seem natural to me to do a numeric comparison with a string.
 
Upvote 0
Hi Chewitt:

Are you trying to delineate a Dynamic Range, extending from cell A8 down? -- if so, the following may be of some interest to you ...
Book3
ABCD
7
81Dyn1=Sheet5!$A$8:INDEX(Sheet5!$A:$A,MATCH(9.99999999999999E+307,Sheet5!$A:$A))
92
103Dyn2=OFFSET(Sheet5!$A$8,0,0,MATCH(9.99999999999999E+307,Sheet5!$A$8:$A$65536))
114
12
13
147
159
168
17
Sheet5


I have created Dyn1 and Dyn2 as dynamic ranges to delineate the cells colored in aqua.

If I have misunderstood your question, my apologies!
 
Upvote 0
What happens if your data is

50
text
100

Your range would only include the "50" and the "text", as it would only offset by 2 (counting the 50 and the 100).

Maybe =OFFSET(Blank!$A$8,0,0,COUNTa(Blank!$A:$A)) is better?
 
Upvote 0
Oaktree said:
What happens if your data is

50
text
100

Your range would only include the "50" and the "text", as it would only offset by 2 (counting the 50 and the 100).

Maybe =OFFSET(Blank!$A$8,0,0,COUNTa(Blank!$A:$A)) is better?

Good point if the range is of mixed data type. However, what happens if we have empty cells before the last used cell under your suggestion?

I think the OP should unambiguously state what kind of data there is in column A.
 
Upvote 0
Wow! I have been a developer for 7 years and have had to start using Excel due to a downturn in the economy. I have never had so many people respond to a post so quickly! My thanks to you all.

All of the data will be contiguous and will be numeric. Data above will be text and will be ignored, thus the starting point $A$8.

Here is a better way of asking the question(s):

Is there a better way to represent the COUNTIF() considering it includes the entire column? Can you use ISNUMBER() in conjunction with COUNTIF()?

It "feels" un-natural to do a numeric comparison with text.
 
Upvote 0
chewitt said:
Wow! I have been a developer for 7 years and have had to start using Excel due to a downturn in the economy. I have never had so many people respond to a post so quickly! My thanks to you all.

All of the data will be contiguous and will be numeric. Data above will be text and will be ignored, thus the starting point $A$8.

Here is a better way of asking the question:
Is there a better way to represent the COUNTIF() considering it includes the entire column?

It "feels" un-natural to do a numeric comparison with text.

=x!$A$8:INDEX(x!$A:$A,MATCH(9.99999999999999E+307,x!$A:$A))

would define a dynamic range, which is insensitive to text and empty cells in between.

If you don't have any empty cells, the following...

=x!$A$8:INDEX(x!$A:$A,COUNTA(x!$A:$A)+CELL("Row",x!$A$8)-1)

will also work

Substitute the relevant sheet name for x.
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,307
Members
449,151
Latest member
JOOJ

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