PC Review


Reply
Thread Tools Rate Thread

count if two values are true

 
 
pep
Guest
Posts: n/a
 
      26th Jan 2008
Hi,

I have in A column hundreds of dates. B column has hudreds of names.

A B
11.01.2008 Tim
12.01.2008 Paul
12.01.2008 Jack
14.01.2008 Paul
......

I would like to count how many times e.g. Paul is mentioned in January 2008.

-Peter


 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      26th Jan 2008

=sumproduct((month(a2:a22)=1)*(b2:b22="Paul"))
to add the year
=sumproduct((year(a2:a22)=2008)*(month(a2:a22)=1)*(b2:b22="Paul"))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"pep" <(E-Mail Removed)> wrote in message
news:IDKmj.287328$(E-Mail Removed)...
> Hi,
>
> I have in A column hundreds of dates. B column has hudreds of names.
>
> A B
> 11.01.2008 Tim
> 12.01.2008 Paul
> 12.01.2008 Jack
> 14.01.2008 Paul
> .....
>
> I would like to count how many times e.g. Paul is mentioned in January
> 2008.
>
> -Peter
>


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      26th Jan 2008
One more:

=sumproduct(--(text(a1:a100,"yyyymm")="200801"),--(b1:b100="Paul"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

====
If you're using xl2007, you should look at excel's help for =countifs().


pep wrote:
>
> Hi,
>
> I have in A column hundreds of dates. B column has hudreds of names.
>
> A B
> 11.01.2008 Tim
> 12.01.2008 Paul
> 12.01.2008 Jack
> 14.01.2008 Paul
> .....
>
> I would like to count how many times e.g. Paul is mentioned in January 2008.
>
> -Peter


--

Dave Peterson
 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      26th Jan 2008
In Excel 2007:

=COUNTIFS(A1:A10,">="&DATE(2008,1,1),A1:A10,"<="&DATE(2008,1,31),B1:B10,"Paul")

Or, using cells to hold the criteria:

D1 = 1/1/2008
E1 = 1/31/2008
F1 = Paul

=COUNTIFS(A1:A10,">="&D1,A1:A10,"<="&E1,B1:B10,F1)

--
Biff
Microsoft Excel MVP


"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> One more:
>
> =sumproduct(--(text(a1:a100,"yyyymm")="200801"),--(b1:b100="Paul"))
>
> Adjust the ranges to match--but you can't use whole columns (except in
> xl2007).
>
> =sumproduct() likes to work with numbers. The -- stuff changes trues and
> falses
> to 1's and 0's.
>
> Bob Phillips explains =sumproduct() in much more detail here:
> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
>
> And J.E. McGimpsey has some notes at:
> http://mcgimpsey.com/excel/formulae/doubleneg.html
>
> ====
> If you're using xl2007, you should look at excel's help for =countifs().
>
>
> pep wrote:
>>
>> Hi,
>>
>> I have in A column hundreds of dates. B column has hudreds of names.
>>
>> A B
>> 11.01.2008 Tim
>> 12.01.2008 Paul
>> 12.01.2008 Jack
>> 14.01.2008 Paul
>> .....
>>
>> I would like to count how many times e.g. Paul is mentioned in January
>> 2008.
>>
>> -Peter

>
> --
>
> Dave Peterson



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      26th Jan 2008
Thanks, Biff.

And from what I've read, =countifs() and =sumifs() are faster than =sumproduct()
and can use the whole column.



"T. Valko" wrote:
>
> In Excel 2007:
>
> =COUNTIFS(A1:A10,">="&DATE(2008,1,1),A1:A10,"<="&DATE(2008,1,31),B1:B10,"Paul")
>
> Or, using cells to hold the criteria:
>
> D1 = 1/1/2008
> E1 = 1/31/2008
> F1 = Paul
>
> =COUNTIFS(A1:A10,">="&D1,A1:A10,"<="&E1,B1:B10,F1)
>
> --
> Biff
> Microsoft Excel MVP
>
> "Dave Peterson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > One more:
> >
> > =sumproduct(--(text(a1:a100,"yyyymm")="200801"),--(b1:b100="Paul"))
> >
> > Adjust the ranges to match--but you can't use whole columns (except in
> > xl2007).
> >
> > =sumproduct() likes to work with numbers. The -- stuff changes trues and
> > falses
> > to 1's and 0's.
> >
> > Bob Phillips explains =sumproduct() in much more detail here:
> > http://www.xldynamic.com/source/xld.SUMPRODUCT.html
> >
> > And J.E. McGimpsey has some notes at:
> > http://mcgimpsey.com/excel/formulae/doubleneg.html
> >
> > ====
> > If you're using xl2007, you should look at excel's help for =countifs().
> >
> >
> > pep wrote:
> >>
> >> Hi,
> >>
> >> I have in A column hundreds of dates. B column has hudreds of names.
> >>
> >> A B
> >> 11.01.2008 Tim
> >> 12.01.2008 Paul
> >> 12.01.2008 Jack
> >> 14.01.2008 Paul
> >> .....
> >>
> >> I would like to count how many times e.g. Paul is mentioned in January
> >> 2008.
> >>
> >> -Peter

> >
> > --
> >
> > Dave Peterson


--

Dave Peterson
 
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
Count values in column only if value of another column is true MikeB Microsoft Excel Worksheet Functions 4 10th Sep 2009 05:19 PM
select multiple values in same row only display true values =?Utf-8?B?SEw=?= Microsoft Access 1 22nd Sep 2006 12:32 AM
Databindings property - I want to disable true values rather than false values Steve Microsoft ASP .NET 4 27th Jan 2006 01:02 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Microsoft Excel Worksheet Functions 9 31st Jul 2005 03:37 AM
Count TRUE only Pat Microsoft Excel Worksheet Functions 5 2nd Feb 2004 06:50 PM


Features
 

Advertising
 

Newsgroups
 


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