Excel - Comparing multiple columns

January 2017



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


Published by aakai1056. Latest update on August 23, 2012 at 09:41 AM by jak58.
This document, titled "Excel - Comparing multiple columns," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).