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

In Excel, is there a way to compare sets of cells to another set of cells (like comparing key-value pairs)?

Column A and Column B as key-value pair #1
Column C and Column D as key-value pair #2

Compare Key-value pair #1 with Key-value pair #2

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

>Solution :

Is this what you mean?

If so, you simply type this kind of formula in the top most cell and drag it down all the way to your last value. Quick and dirty.

=IF(A2=C2,IF(B2=D2,TRUE,FALSE),FALSE)

Otherwise, here is another approach:
You can also use this kind of formula if the key/value pairs aren't required to be on the same line:

=IFERROR( IF(VLOOKUP(C2,A$2:B$999,2,FALSE)=D2,"match","no match"),"Not found")

CREDIT to AC who provided the second part of the answer in this post: https://stackoverflow.com/a/33303583/22876455

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