|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
I need a function that simply counts the number of cells in a range. Not based on a condtion, simply the number of cells in a range.
Obviously if I'm doing this once I can simply put in a constant. (It's easy to see that the range A1:A50 has 50 cells.) But I need a formula that will automatically adjust if the size of the range changes, so that if I insert a row after A17, the formula will return 51.
As far as I can tell, COUNT, COUNTA, and COUNTIF don't do this. I suppose I could use COUNTIF(A1:A50,"<>999"), where 999 is a value that I know will not appear in the range.
But is there a more straightforward formula?
Thanks.
|
|
If it's a single area, how about: =rows(myrng)*columns(myrng)
Eric wrote:
[Quoted Text] > > I need a function that simply counts the number of cells in a range. Not > based on a condtion, simply the number of cells in a range. > > Obviously if I'm doing this once I can simply put in a constant. (It's easy > to see that the range A1:A50 has 50 cells.) But I need a formula that will > automatically adjust if the size of the range changes, so that if I insert a > row after A17, the formula will return 51. > > As far as I can tell, COUNT, COUNTA, and COUNTIF don't do this. I suppose I > could use COUNTIF(A1:A50,"<>999"), where 999 is a value that I know will not > appear in the range. > > But is there a more straightforward formula? > > Thanks.
--
Dave Peterson
|
|
=CELL("row",B11)-CELL("row",B2)
-- Don Guillett SalesAid Software dguillett1[ at ]austin.rr.com "Eric" <Eric[ at ]discussions.microsoft.com> wrote in message news:6E57EB22-59EB-45CE-818F-C3780F1FE33B[ at ]microsoft.com...
[Quoted Text] >I need a function that simply counts the number of cells in a range. Not > based on a condtion, simply the number of cells in a range. > > Obviously if I'm doing this once I can simply put in a constant. (It's > easy > to see that the range A1:A50 has 50 cells.) But I need a formula that > will > automatically adjust if the size of the range changes, so that if I insert > a > row after A17, the formula will return 51. > > As far as I can tell, COUNT, COUNTA, and COUNTIF don't do this. I suppose > I > could use COUNTIF(A1:A50,"<>999"), where 999 is a value that I know will > not > appear in the range. > > But is there a more straightforward formula? > > Thanks.
|
|
Thanks. That solves the problem.
I'm an occasional user of Excel, and I just don't know all the functions. I knew there had to be some simple solution!
"Dave Peterson" wrote:
[Quoted Text] > If it's a single area, how about: > =rows(myrng)*columns(myrng) > > Eric wrote: > > > > I need a function that simply counts the number of cells in a range. Not > > based on a condtion, simply the number of cells in a range. > > > > Obviously if I'm doing this once I can simply put in a constant. (It's easy > > to see that the range A1:A50 has 50 cells.) But I need a formula that will > > automatically adjust if the size of the range changes, so that if I insert a > > row after A17, the formula will return 51. > > > > As far as I can tell, COUNT, COUNTA, and COUNTIF don't do this. I suppose I > > could use COUNTIF(A1:A50,"<>999"), where 999 is a value that I know will not > > appear in the range. > > > > But is there a more straightforward formula? > > > > Thanks. > > -- > > Dave Peterson >
|
|
|