Excel - Comparing multiple columns

November 2016



Issue


I would like to compare two columns:
A B C D  
Peter 4John3  
John  3Peter 5  
Greg 2Greg 6  
Emily 8 


I would like to see which Names I can not find in Column C that are present in Column A. This is easy, i do that with IF. But I would like to take it further, when there is a match, I would like excel to deduct the Number from Column B from the Number from Column D. For example I would have 4 for Greg (6 minus 2).

Solution


"I would like to see which Names I can not find in Column C that are present in Column A" : did you forget to add "in the same row) .

If data is in rows 1 to 4
in D1 copy this formula
=IF(C1=A1,D1-B1,"NO") 


copy this formula down.
modify formula for what happens the names inC and A are not the same.

Thanks to venkat1926 for this tip.

Related :

This document entitled « Excel - Comparing multiple columns » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.