A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

countif - Criterion1 OR [Criterion2 AND Criterion3]



 
 
Thread Tools Display Modes
  #1  
Old September 8th, 2005, 12:03 PM
0-0 Wai Wai ^-^
external usenet poster
 
Posts: n/a
Default countif - Criterion1 OR [Criterion2 AND Criterion3]


I wish to do the following:
=countif(TargetCell or TargetCells, Criterion1 OR [Criterion2 AND Criterion3])

eg: =countif(A1, Criterion1 OR [Criterion2 AND Criterion3])
eg: =countif(A1:A10, Criterion1 OR [Criterion2 AND Criterion3])

How to do?

Thanks.

--
Additional information:
- I'm using Office XP
- I'm using Windows XP


  #2  
Old September 8th, 2005, 01:59 PM
bj
external usenet poster
 
Posts: n/a
Default

countif won't work well for this.
try sumproduct()

=sumproduct(or(targetcells=Crierion1,and(Targetcel ls=criterion2,targetcells=criterion3)))

"0-0 Wai Wai ^-^" wrote:


I wish to do the following:
=countif(TargetCell or TargetCells, Criterion1 OR [Criterion2 AND Criterion3])

eg: =countif(A1, Criterion1 OR [Criterion2 AND Criterion3])
eg: =countif(A1:A10, Criterion1 OR [Criterion2 AND Criterion3])

How to do?

Thanks.

--
Additional information:
- I'm using Office XP
- I'm using Windows XP



  #3  
Old September 8th, 2005, 05:05 PM
Aladin Akyurek
external usenet poster
 
Posts: n/a
Default

=SUMPRODUCT(--ISNUMBER(MATCH(TargetRange,CritList,0)))

where CritList refers to a range that houses the relevant criteria.

0-0 Wai Wai ^-^ wrote:
I wish to do the following:
=countif(TargetCell or TargetCells, Criterion1 OR [Criterion2 AND Criterion3])

eg: =countif(A1, Criterion1 OR [Criterion2 AND Criterion3])
eg: =countif(A1:A10, Criterion1 OR [Criterion2 AND Criterion3])

How to do?

Thanks.

  #4  
Old September 8th, 2005, 05:16 PM
Harlan Grove
external usenet poster
 
Posts: n/a
Default

Aladin Akyurek wrote...
=SUMPRODUCT(--ISNUMBER(MATCH(TargetRange,CritList,0)))

where CritList refers to a range that houses the relevant criteria.

....

That'd work for a single equality criteria, but that's not what the OP
asked. Looks like the OP needs something closer to

=SUMPRODUCT(--((range=Crit1)+((range=Crit2)*(range=Crit3)) 0))

where = is just a placeholder for any of the comparison operators.
It'd be more complicated with text criteria including wildcards.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.