ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   COUNTIF (https://www.excelbanter.com/excel-discussion-misc-queries/44227-countif.html)

nsharpe

COUNTIF
 
COUNTIF seems to require a continuous range of cells to be inserted in the
formula.
I have a series of discontinuous cells from which I wish to count all those
that have the value 1.
COUNTIF((A1,C3,D5),1) for example returns #VALUE#. Using colons as
separators does not work either.
Any suggestions?


WLMPilot

I tried the formula as a range and it worked. The formula I used was:

=COUNTIF(A1:D5,1)

Hope this helps,
Les



"nsharpe" wrote:

COUNTIF seems to require a continuous range of cells to be inserted in the
formula.
I have a series of discontinuous cells from which I wish to count all those
that have the value 1.
COUNTIF((A1,C3,D5),1) for example returns #VALUE#. Using colons as
separators does not work either.
Any suggestions?


JE McGimpsey

One way:

=(A1=1)+(C3=1)+(D5=1)




In article ,
"nsharpe" wrote:

COUNTIF seems to require a continuous range of cells to be inserted in the
formula.
I have a series of discontinuous cells from which I wish to count all those
that have the value 1.
COUNTIF((A1,C3,D5),1) for example returns #VALUE#. Using colons as
separators does not work either.
Any suggestions?


Vincnet.

Maybe....
Insert/Name/Define
=A1,C3,D5
as RangeTest for example
and then: =COUNTIF(RangeTest,1)
Does it help?
--
A+

V.


"nsharpe" wrote:

COUNTIF seems to require a continuous range of cells to be inserted in the
formula.
I have a series of discontinuous cells from which I wish to count all those
that have the value 1.
COUNTIF((A1,C3,D5),1) for example returns #VALUE#. Using colons as
separators does not work either.
Any suggestions?


CLR

Brute force.......

=SUM(COUNTIF(A1,1),COUNTIF(C3,1),COUNTIF(D5,1))

Vaya con Dios,
Chuck, CABGx3



"nsharpe" wrote:

COUNTIF seems to require a continuous range of cells to be inserted in the
formula.
I have a series of discontinuous cells from which I wish to count all those
that have the value 1.
COUNTIF((A1,C3,D5),1) for example returns #VALUE#. Using colons as
separators does not work either.
Any suggestions?


Vincnet.

forget it....
--
A+

V.


"Vincnet." wrote:

Maybe....
Insert/Name/Define
=A1,C3,D5
as RangeTest for example
and then: =COUNTIF(RangeTest,1)
Does it help?
--
A+

V.


"nsharpe" wrote:

COUNTIF seems to require a continuous range of cells to be inserted in the
formula.
I have a series of discontinuous cells from which I wish to count all those
that have the value 1.
COUNTIF((A1,C3,D5),1) for example returns #VALUE#. Using colons as
separators does not work either.
Any suggestions?


JE McGimpsey

In article ,
"Vincnet." wrote:

Maybe....
Insert/Name/Define
=A1,C3,D5
as RangeTest for example
and then: =COUNTIF(RangeTest,1)
Does it help?


Did you try it yourself?

Sandy Mann

I don't say that it is a good solution but try:

=SUM(COUNTIF(INDIRECT({"A1","C3","D5"}),1))

--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk


"nsharpe" wrote in message
...
COUNTIF seems to require a continuous range of cells to be inserted in the
formula.
I have a series of discontinuous cells from which I wish to count all
those
that have the value 1.
COUNTIF((A1,C3,D5),1) for example returns #VALUE#. Using colons as
separators does not work either.
Any suggestions?





All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com