PC Review


Reply
Thread Tools Rate Thread

How to count sets of numbers

 
 
JimDandy
Guest
Posts: n/a
 
      29th Mar 2006

I am trying to determine how many items in a pair of columns meet
certain criteria. For instance, I have two rows, side by side, where
each cell contains a single digit, a 1, 2 or 3. I need to count the
number of rows where both columns contain a 1, or both contain a 2, or
where one column contains a 1 and the row next to it contains a 3. In
the example list below I would need to determine how many rows contain
1’s in both columns, and how many rows contain a 3 in one column and a
2 in the other, etc. So, given the following data...

Code:
--------------------

Row A Row B
1 1
1 2
1 1
2 3
3 1
3 3

--------------------

...the results I am looking for would resemble something like this:
1-1 = 2
1-2 = 1
1-3 = 0
2-1 = 0
2-2 = 0
3-3 = 1
3-1 = 1
3-2 = 0
3-3 = 1


--
JimDandy
------------------------------------------------------------------------
JimDandy's Profile: http://www.excelforum.com/member.php...o&userid=16578
View this thread: http://www.excelforum.com/showthread...hreadid=527797

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Qi4gUi5SYW1hY2hhbmRyYW4=?=
Guest
Posts: n/a
 
      29th Mar 2006
Hi,

Let's assume that your data are in say A2:A7, and B2:B7.
In two new columns, say C2:C10 and D210, enter the combinations, as shown
below:

C D
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3

In E2, enter the following formula and autofill it down to E10.
=SUMPRODUCT(($A$2:$A$7=C2)*($B$2:$B$7=D2))


Regards,
B. R. Ramachandran



"JimDandy" wrote:

>
> I am trying to determine how many items in a pair of columns meet
> certain criteria. For instance, I have two rows, side by side, where
> each cell contains a single digit, a 1, 2 or 3. I need to count the
> number of rows where both columns contain a 1, or both contain a 2, or
> where one column contains a 1 and the row next to it contains a 3. In
> the example list below I would need to determine how many rows contain
> 1’s in both columns, and how many rows contain a 3 in one column and a
> 2 in the other, etc. So, given the following data...
>
> Code:
> --------------------
>
> Row A Row B
> 1 1
> 1 2
> 1 1
> 2 3
> 3 1
> 3 3
>
> --------------------
>
> ...the results I am looking for would resemble something like this:
> 1-1 = 2
> 1-2 = 1
> 1-3 = 0
> 2-1 = 0
> 2-2 = 0
> 3-3 = 1
> 3-1 = 1
> 3-2 = 0
> 3-3 = 1
>
>
> --
> JimDandy
> ------------------------------------------------------------------------
> JimDandy's Profile: http://www.excelforum.com/member.php...o&userid=16578
> View this thread: http://www.excelforum.com/showthread...hreadid=527797
>
>

 
Reply With Quote
 
JimDandy
Guest
Posts: n/a
 
      29th Mar 2006

That was just the ticket, thanks for teh quick and accurate reply


--
JimDandy
------------------------------------------------------------------------
JimDandy's Profile: http://www.excelforum.com/member.php...o&userid=16578
View this thread: http://www.excelforum.com/showthread...hreadid=527797

 
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
formula to count sets of repeating numbers Excel-User-RR Microsoft Excel Worksheet Functions 6 16th Feb 2009 06:14 PM
How do I count sets of cells in two columns? David Microsoft Excel Worksheet Functions 2 30th Jul 2008 10:21 PM
COUNT IF + using 2 sets of data mail@toniasears.co.uk Microsoft Excel Programming 4 17th Jul 2007 01:34 PM
2 sets of page numbers (different numbers) =?Utf-8?B?YmJyb3du?= Microsoft Word Document Management 1 16th Nov 2004 08:29 PM
Sets of numbers =?Utf-8?B?QW50b25pbw==?= Microsoft Excel Misc 1 29th Sep 2004 10:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:34 PM.