From: Marty on
How do I use the countif on non-concecutive cells, i.e. I want to know the
number of certain cells in worksheet that contain a specific value. For
instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
--
Marty
From: Teethless mama on
=SUM(COUNTIF(INDIRECT({"A1:A5","A7","A15:A18"}),1))


"Marty" wrote:

> How do I use the countif on non-concecutive cells, i.e. I want to know the
> number of certain cells in worksheet that contain a specific value. For
> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
> --
> Marty
From: T. Valko on
If you only have a "few" cells to check:

=(A1=1)+(A5=1)+(A7=1)+(A15=1)+(A18=1)

If you have "many" cells to check it depends on the range of numbers that
the cells can contain but you use something like this if the lowest possible
number is the number 1:

=INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)

--
Biff
Microsoft Excel MVP


"Marty" <Marty(a)discussions.microsoft.com> wrote in message
news:13F15110-BC01-4408-AA7A-FDC8BB5F21B9(a)microsoft.com...
> How do I use the countif on non-concecutive cells, i.e. I want to know the
> number of certain cells in worksheet that contain a specific value. For
> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
> --
> Marty


From: Teethless mama on
Non Volatile formula

=COUNTIF(A1:A5,1)+(A7=1)+COUNTIF(A15:A18,1)


"Marty" wrote:

> How do I use the countif on non-concecutive cells, i.e. I want to know the
> number of certain cells in worksheet that contain a specific value. For
> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
> --
> Marty
From: T. Valko on
>if the lowest possible number is the number 1:
>=INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)

If the lowest possible number is the number 1 that can be reduced to:

=FREQUENCY((A1,A5,A7,A15,A18),1)

>how many cells in a1:a5, a7, a15:a18 contain the value of 1.

Also, due to my poor eyesight I didn't notice that A1:A5 and A15:A18 were
ranges but that doesn't make any difference:

=FREQUENCY((A1:A5,A7,A15:A18),1)

--
Biff
Microsoft Excel MVP


"T. Valko" <biffinpitt(a)comcast.net> wrote in message
news:OO03oCbuKHA.796(a)TK2MSFTNGP05.phx.gbl...
> If you only have a "few" cells to check:
>
> =(A1=1)+(A5=1)+(A7=1)+(A15=1)+(A18=1)
>
> If you have "many" cells to check it depends on the range of numbers that
> the cells can contain but you use something like this if the lowest
> possible number is the number 1:
>
> =INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "Marty" <Marty(a)discussions.microsoft.com> wrote in message
> news:13F15110-BC01-4408-AA7A-FDC8BB5F21B9(a)microsoft.com...
>> How do I use the countif on non-concecutive cells, i.e. I want to know
>> the
>> number of certain cells in worksheet that contain a specific value. For
>> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
>> --
>> Marty
>
>


 |  Next  |  Last
Pages: 1 2
Prev: Pivot Table 'Validation'?
Next: printing a report