View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default comparing tables/vectors

Thanks Peo...I appreciate the feedback.
Sometimes I forget to test if CSE is not necessary.

***********
Regards,
Ron


"Peo Sjoblom" wrote:

Not a big deal Ron but you don't need to array enter this

--

Regards,

Peo Sjoblom


"Ron Coderre" wrote in message
...
Try this:

If your values are in Cells A1:B10

C1: =SUMPRODUCT(--COUNTIF(A1:A10,B1:B10))
Note: Commit that array formula by holding down [Ctrl]+[Shift] when you
press [Enter]

Returns the number of common elements from Col_A and Col_B

Note: There can be no repeats withing the same column.

Does that help?

***********
Regards,
Ron


"Uka P." wrote:

Hi there :-)


I have two columns with numeric data [but the kind of data shouldn't
matter, I suppose]. They're of _different_ lenght, but there are empty
cells below both of them.
I want to compare the columns and get the _number_ [amount] of mutual
elements as a result.

Ie.: if A={2, 3, 5, 7, 9, 23, 25, 46}, and
B={1, 3, 4, 6, 7, 8, 9, 46}
than Result=4



If I defined the columns to have the same lenght [including some of the
empty cells below] would the empty cells be counted as well? I wouldn't
like that :-)

Thanks in advance, regards.

--
Uka P.