Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
0-0 Wai Wai ^-^
 
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   Report Post  
bj
 
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   Report Post  
Aladin Akyurek
 
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   Report Post  
Harlan Grove
 
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:33 AM.

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

About Us

"It's about Microsoft Excel"