ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   CountIf Q (https://www.excelbanter.com/excel-worksheet-functions/175749-countif-q.html)

Sean

CountIf Q
 
Can the formula below work, I get a #Value! returned so I assume I
have a syntax wrong. Tried entering as an Array, but still the same. I
know =COUNTIF(C12:C14,"Yes") works but I want to skip C13

=COUNTIF((C12,C14),"Yes")

Ron Rosenfeld

CountIf Q
 
On Wed, 6 Feb 2008 03:56:32 -0800 (PST), Sean wrote:

Can the formula below work, I get a #Value! returned so I assume I
have a syntax wrong. Tried entering as an Array, but still the same. I
know =COUNTIF(C12:C14,"Yes") works but I want to skip C13

=COUNTIF((C12,C14),"Yes")


=(C12="Yes")+(C14="yes")


--ron

Mike H

CountIf Q
 
Hi,

Try this

=COUNTIF(C12,"Yes")+COUNTIF(C14,"Yes")
Mike

"Sean" wrote:

Can the formula below work, I get a #Value! returned so I assume I
have a syntax wrong. Tried entering as an Array, but still the same. I
know =COUNTIF(C12:C14,"Yes") works but I want to skip C13

=COUNTIF((C12,C14),"Yes")


Sean

CountIf Q
 
Thanks Ron, knew it was simple


Ron Rosenfeld

CountIf Q
 
On Wed, 6 Feb 2008 04:48:02 -0800 (PST), Sean wrote:

Thanks Ron, knew it was simple


You're welcome. Seems COUNTIF won't take a non-contiguous range as an
argument. So you could do several COUNTIF's, but it seems simpler to just add
the equalities as Excel will automagically convert those to a 1 or 0 depending
on the result being TRUE or FALSE.

If you had several multi-cell discontiguous ranges, (as opposed to just two
cells), then serial COUNTIF's might be more efficient. eg:

=COUNTIF(A1:A10,"YES") + COUNTIF(C8:D10,"YES")


--ron

Bob Phillips

CountIf Q
 
It can be 'persuaded'

=SUMPRODUCT(--COUNTIF(INDIRECT({"C12","C14"}),"Yes"))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Ron Rosenfeld" wrote in message
...
On Wed, 6 Feb 2008 04:48:02 -0800 (PST), Sean
wrote:

Thanks Ron, knew it was simple


You're welcome. Seems COUNTIF won't take a non-contiguous range as an
argument. So you could do several COUNTIF's, but it seems simpler to just
add
the equalities as Excel will automagically convert those to a 1 or 0
depending
on the result being TRUE or FALSE.

If you had several multi-cell discontiguous ranges, (as opposed to just
two
cells), then serial COUNTIF's might be more efficient. eg:

=COUNTIF(A1:A10,"YES") + COUNTIF(C8:D10,"YES")


--ron




Teethless mama

CountIf Q
 
Or

=SUM(COUNTIF(INDIRECT({"C12","C14"}),"Yes"))


"Bob Phillips" wrote:

It can be 'persuaded'

=SUMPRODUCT(--COUNTIF(INDIRECT({"C12","C14"}),"Yes"))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Ron Rosenfeld" wrote in message
...
On Wed, 6 Feb 2008 04:48:02 -0800 (PST), Sean
wrote:

Thanks Ron, knew it was simple


You're welcome. Seems COUNTIF won't take a non-contiguous range as an
argument. So you could do several COUNTIF's, but it seems simpler to just
add
the equalities as Excel will automagically convert those to a 1 or 0
depending
on the result being TRUE or FALSE.

If you had several multi-cell discontiguous ranges, (as opposed to just
two
cells), then serial COUNTIF's might be more efficient. eg:

=COUNTIF(A1:A10,"YES") + COUNTIF(C8:D10,"YES")


--ron






All times are GMT +1. The time now is 06:02 AM.

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