Comparing two columns in excel sheet
I have 3 columns A B C D 11H 3HI xyz 2AB 2CD dfd 3HI 11H 123 I would like to compare column A & B and if matched the adjucent cell value should be written in column D. For example A B C D 11H 3HI xyz 123 2AB 2CD dfd --- 3HI 11H 123 xyz. Answer: The formula we're after is: =VLOOKUP(A1,$B$1:$C$3,2,FALSE) Here's an image. Always show your attempts. We tend to help those who have attempted to help themselves more. However, if the dashes are a must instead of the #N/A in D2, then this is the formula =IFERROR(VLOOKUP(A3,$B$1:$C$3,2,FALSE),"---")