Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2007

Tip: Looking for answers? Try searching our database.

Counting Occurrences in two different columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dustinaspray@gmail.com - 12 Jan 2007 15:38 GMT
I have two columns of data and want to count the number of occurences
when one column has something and they other something else.  For
example I want to count the total number of occurences that have
Atlanta and 2.  The answer should be 3.  How do you do this?

    A                       B
1  Atlanta              2
2  Atlanta              3
3  Chicago             2
4  Atlanta              2
5  Atlanta              1
6  Atlanta              2
Dave Peterson - 12 Jan 2007 15:53 GMT
=sumproduct(--(a1:a10="Atlanta"),--(b1:b10=2))

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

===
And if you're using xl2007, take a look at:

=countifs()
in excel's help.

> I have two columns of data and want to count the number of occurences
> when one column has something and they other something else.  For
[quoted text clipped - 8 lines]
> 5  Atlanta              1
> 6  Atlanta              2

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.