PC Review


Reply
Thread Tools Rate Thread

countif for multiple criteria?

 
 
tracktraining
Guest
Posts: n/a
 
      4th Mar 2009
Hi All,

Is there a way to count only if both conditions are met? for example, count
only if column E contains "*bat*" and column K contains "*yes*", otherwise
don't count it.

any suggestion?

thanks,
Tracktraining
--
Learning
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      4th Mar 2009
Any time you need multiple criteria, think SUMPRODUCT()

=SUMPRODUCT((E1:E100="*bat*")*(K1:K100="*yes*"))

see:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
for the complete story.

--
Gary''s Student - gsnu200836


"tracktraining" wrote:

> Hi All,
>
> Is there a way to count only if both conditions are met? for example, count
> only if column E contains "*bat*" and column K contains "*yes*", otherwise
> don't count it.
>
> any suggestion?
>
> thanks,
> Tracktraining
> --
> Learning

 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      4th Mar 2009
Try

=COUNT(IF(ISNUMBER(SEARCH("BAT",E1:E13)),IF(ISNUMBER(SEARCH("YES",K1:K13)),1)))

'This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array

Mike



"tracktraining" wrote:

> Hi All,
>
> Is there a way to count only if both conditions are met? for example, count
> only if column E contains "*bat*" and column K contains "*yes*", otherwise
> don't count it.
>
> any suggestion?
>
> thanks,
> Tracktraining
> --
> Learning

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      4th Mar 2009
Sumproduct and wildcards!! tested?

"Gary''s Student" wrote:

> Any time you need multiple criteria, think SUMPRODUCT()
>
> =SUMPRODUCT((E1:E100="*bat*")*(K1:K100="*yes*"))
>
> see:
> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
> for the complete story.
>
> --
> Gary''s Student - gsnu200836
>
>
> "tracktraining" wrote:
>
> > Hi All,
> >
> > Is there a way to count only if both conditions are met? for example, count
> > only if column E contains "*bat*" and column K contains "*yes*", otherwise
> > don't count it.
> >
> > any suggestion?
> >
> > thanks,
> > Tracktraining
> > --
> > Learning

 
Reply With Quote
 
Eduardo
Guest
Posts: n/a
 
      4th Mar 2009
Hi
try

=COUNTIF(e2:e15,"Bat")-COUNTIF(k2:k15,"yes")

"tracktraining" wrote:

> Hi All,
>
> Is there a way to count only if both conditions are met? for example, count
> only if column E contains "*bat*" and column K contains "*yes*", otherwise
> don't count it.
>
> any suggestion?
>
> thanks,
> Tracktraining
> --
> Learning

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      4th Mar 2009
Tested with the asterisk a real asterisk, not a wildcard.
--
Gary''s Student - gsnu200836


"Mike H" wrote:

> Sumproduct and wildcards!! tested?
>
> "Gary''s Student" wrote:
>
> > Any time you need multiple criteria, think SUMPRODUCT()
> >
> > =SUMPRODUCT((E1:E100="*bat*")*(K1:K100="*yes*"))
> >
> > see:
> > http://www.xldynamic.com/source/xld.SUMPRODUCT.html
> > for the complete story.
> >
> > --
> > Gary''s Student - gsnu200836
> >
> >
> > "tracktraining" wrote:
> >
> > > Hi All,
> > >
> > > Is there a way to count only if both conditions are met? for example, count
> > > only if column E contains "*bat*" and column K contains "*yes*", otherwise
> > > don't count it.
> > >
> > > any suggestion?
> > >
> > > thanks,
> > > Tracktraining
> > > --
> > > Learning

 
Reply With Quote
 
Mike H
Guest
Posts: n/a
 
      4th Mar 2009
> > > > only if column E contains "*bat*" and column K contains "*yes*",

Apologies I read the post differently

Mike

"Gary''s Student" wrote:

> Tested with the asterisk a real asterisk, not a wildcard.
> --
> Gary''s Student - gsnu200836
>
>
> "Mike H" wrote:
>
> > Sumproduct and wildcards!! tested?
> >
> > "Gary''s Student" wrote:
> >
> > > Any time you need multiple criteria, think SUMPRODUCT()
> > >
> > > =SUMPRODUCT((E1:E100="*bat*")*(K1:K100="*yes*"))
> > >
> > > see:
> > > http://www.xldynamic.com/source/xld.SUMPRODUCT.html
> > > for the complete story.
> > >
> > > --
> > > Gary''s Student - gsnu200836
> > >
> > >
> > > "tracktraining" wrote:
> > >
> > > > Hi All,
> > > >
> > > > Is there a way to count only if both conditions are met? for example, count
> > > > only if column E contains "*bat*" and column K contains "*yes*", otherwise
> > > > don't count it.
> > > >
> > > > any suggestion?
> > > >
> > > > thanks,
> > > > Tracktraining
> > > > --
> > > > Learning

 
Reply With Quote
 
Alberto Ast
Guest
Posts: n/a
 
      4th Mar 2009
When I need this condition I add a third column with a =Concatenate(e2,k2)
function and then =countif(range,batyes).. you can hide the third column.

"Eduardo" wrote:

> Hi
> try
>
> =COUNTIF(e2:e15,"Bat")-COUNTIF(k2:k15,"yes")
>
> "tracktraining" wrote:
>
> > Hi All,
> >
> > Is there a way to count only if both conditions are met? for example, count
> > only if column E contains "*bat*" and column K contains "*yes*", otherwise
> > don't count it.
> >
> > any suggestion?
> >
> > thanks,
> > Tracktraining
> > --
> > Learning

 
Reply With Quote
 
tracktraining
Guest
Posts: n/a
 
      4th Mar 2009
Thanks all for helping out. I tried every suggestion and the one that works
for me is Mike’s:
=COUNT(IF(ISNUMBER(SEARCH("*xoft*",E1:E14)),IF(ISNUMBER(SEARCH("*yes*",K1:K14)),1)))


Thanks again.

--
Learning


"Mike H" wrote:

> Try
>
> =COUNT(IF(ISNUMBER(SEARCH("BAT",E1:E13)),IF(ISNUMBER(SEARCH("YES",K1:K13)),1)))
>
> 'This is an array formula which must be entered with CTRL+Shift+Enter and NOT
> 'just enter. If you do it correctly then Excel will put curly brackets around
> 'the formula{}. You can't type these yourself. If you Edit the ranges
> 'then you must re-enter as An array
>
> Mike
>
>
>
> "tracktraining" wrote:
>
> > Hi All,
> >
> > Is there a way to count only if both conditions are met? for example, count
> > only if column E contains "*bat*" and column K contains "*yes*", otherwise
> > don't count it.
> >
> > any suggestion?
> >
> > thanks,
> > Tracktraining
> > --
> > Learning

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
countif AND countif something else too! Tim3057 Microsoft Excel Programming 1 12th Jan 2006 06:17 PM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Microsoft Excel Misc 2 25th Sep 2005 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet =?Utf-8?B?RWxsaWU=?= Microsoft Excel Worksheet Functions 4 15th Sep 2005 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? =?Utf-8?B?Sm9ubmllUA==?= Microsoft Excel Worksheet Functions 3 22nd Feb 2005 03:55 PM
Countif - Countif maswinney Microsoft Excel Worksheet Functions 3 16th Nov 2004 12:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:39 AM.