Excel – How to compare two columns and if match return a value

microsoft excelmicrosoft-excel-2010worksheet-function

How Can I compare the entries on TAB: SUMMARY SLS, column B with SUMMARY P&S, column B and bring back a "X" if a match is found in the cell with the formula? SUMMARY SLS and SUMMARY P&S are database tab/sheet names within the same spreadsheet.

The cells in column B are filled with unique values on each separate sheet but should match between the two sheets. If one of the values on one sheet doesn't have a match on the other sheet then I would like it to return a blank. My formula will be typed in column G.

The only thing I have tried so far is a simple vlookup which would bring the corresponding match from the other spreadsheet but what I need is to have my formular answer the question, "Is there a match between SUMMARY SLS Column B and SUMMARY P&S column B and if so place an "X" in this cell, if not leave blank

Best Answer

Based on what I have understood...You can explore VLOOKUP function. I am assuming that "X" is content of column somewhere next to the column B in P&S sheet.

Sample formula

=IF(ISERROR(VLOOKUP(B1,'P&S'!$B$1:$C$6,2,FALSE)),"",VLOOKUP(B1,'P&S'!$B$1:$C$6,2,FALSE))

B1 - Contents of cell B1 (in SLS sheet) VLOOKUP B1 against range of B1 thru B6 (in this case) in sheet P&S and if match is found pull contents of 2nd column (your X) in formula cell.

IF is required to remove #N/A (not found) and replace with "" (Blank)

Don't forget prefix $ to prevent range being moved down as you copy formula

Related Question