Presumably Cells a6:a65536 are empty and therefore are not = x and so get
counted.
Try something like
=offset(sheet1!$a$1,0,0,countif(sheet1!$a:$a,"<x" )-countif(sheet1!$a:$a,"="),1)
Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com
"Arishy" wrote in message
...
Created A Dynamic range with this formula
=offset(sheet1!$a$1,0,0,countif(sheet1!$a:$a,"<x" ),1) call it
MyRange
Col A:
1 AAA
2 BBB
3 CCC
4 x
5 x
IF I go to VBA and use Immediate Windows and I type:
? Range("MyRange").Rows.Count ................... I get
65531 ( I am using Excel 2007 )
My logic tells me it should be 3
Now if I go to A6 and type =CountIF(a1:a5,"<x")
I get 3
Can someone enlighten me ????