Count example dosen't work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

One of the formulas in excel help =COUNT(A2:A8,2) that is to count the number of cells that contain numbers in the list A2:A8, and the value 2 dosen't work. Does anyone know why?
 
Hi Domenic,

Actually the formula does work. It counts the number 2 as
a single value, not each occurance of 2 in the range. In
the example, there are 3 numeric values that get counted
plus the number 2, to give the result of 4.

In that example, you could substitute the number 2 with
any other number and still get the same result. How or why
you would use this I don't know! I've never used COUNT in
this manner.

Biff

-----Original Message-----
One of the formulas in excel help =COUNT(A2:A8,2) that is
to count the number of cells that contain numbers in the
list A2:A8, and the value 2 dosen't work. Does anyone
know why?
 
Just to clarify slightly, take the following:-

A
2 1
3
4 3
5
6 2
7 2
8

=COUNT(A2:A8) would give you 4

=COUNT(A2:A8,2) would give you 5 and is the same as
=COUNT(A2:A8) + 1

=COUNT(A2:A8,2,3,4,5,6,7,8) would give you 11 and is the same as
=COUNT(A2:A8) + 1 + 1 + 1 + 1 + 1 + 1 + 1

Each value within the list of arguments represents 1, whatever it's actual value
is, and for each value it is this representation of 1 that is added to the count
of values within the range.

=COUNT(A2:A8,2,3,"Hello",5,6,7,8) is perfectly valid, and would give you 10, ie
=COUNT(A2:A8) + 1 + 1 + 0 + 1 + 1 + 1 + 1
 
Thanks for the added input Ken. I think it could be said
that the number 2 in the formula is simply the second
argument in the COUNT function, A2:A8 being the first.

I think the OP makes a valid observation in that sometimes
XL Help can be quite confusing.

Biff
 
If you want to count the cells that contain the number 2, use the
COUNTIF function: =COUNTIF(A2:A8,2)
 
Back
Top