close

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 ARow 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: www.excelforum.com/member.php...oamp;userid=16578
View this thread: www.excelforum.com/showthread...hreadid=527797Hi,

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
quot;JimDandyquot; wrote:

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


That was just the ticket, thanks for teh quick and accurate reply--
JimDandy
------------------------------------------------------------------------
JimDandy's Profile: www.excelforum.com/member.php...oamp;userid=16578
View this thread: www.excelforum.com/showthread...hreadid=527797

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()