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

Google Sheets: count how many cells in a range exactly match a corresponding range

I have a row of cells, let’s just say A1:K:1 and I’m trying to count how many times each cell in this range matches the corresponding cell in a range below it, eg A3:K3. So, if A1=A3 that’s 1. If B1=B3 that’s 2. If C1=/=C3, don’t count it. If D1=D3 we’re at 3 total. And so on.

I thought wrapping countif around an IF function would do it, but neither my countif function or if seem to be behaving as I expected.

I even just tried doing a basic countif A1=A3 + B1=B3 etc until K1=K3 but that didn’t even work.

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

Any and all help is extremely appreciated!

>Solution :

The following has the desired behaviour:

=COUNTIF(ARRAYFORMULA(EQ(A1:K1, A2:K2)), TRUE)

There might be a simpler solution, but this is what first came to mind!

Hope this helps.

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