Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Count of pairs that don't equal to each other in 2 ranges

Say I have this simple table:

enter image description here

I want to calculate the count of pairs that don’t equal to each other. In this example only the first row has a matching pair, other 3 pairs don’t match, so it should return 3. To add a bit more complexity, both column A and B are dynamic ranges (with same length).

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried to use countif(A1:A4<>B1:B4, TRUE) but it doesn’t work. What would be a simple way to achieve this?

Thanks!

>Solution :

Use SUMPRODUCT:

=SUMPRODUCT(--(A1:A4<>B1:B4))

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading