VLOOKUP matches one value to a column of data, then returns a value to the right of the match in another column.
So, if on Sheet2 you had names and IDs like so:
Then on Sheet1 you were had a name in cell A2, in B2 you could put this formula to "VLOOKUP" the ID number over on Sheet2:
=VLOOKUP(A1,Sheet2!$A$2:B$20,2,0)
So, if you were comparing A2 to B2 and if they don't match, looking up the customer ID on sheet2 in column B and the value to match to your A1 is in column A on Sheet2, then the formula would look something like this:
=IF(A2=B2,"Match",VLOOKUP(A1,Sheet2!$A$2:B$20,2,0))
Bookmarks