Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have this scenario:

  • Worksheet 1 with Column A only
  • Worksheet 2 with Column A and B

I have to compare Column A (Worksheet 1) and Column A (Worksheet 2).

If a value in Column A (Worksheet 1) is existing in Column A (Worksheet 2), it must show the value in Column B (Worksheet 2).

Please help. I have been trying to do this. I can only compare the Column A of both worksheets but I cannot show the Column B.

share|improve this question

migrated from stackoverflow.com Aug 15 '11 at 19:02

This question came from our site for professional and enthusiast programmers.

    
What "value" are you looking to place in column B of Sheet2? If you are looking for duplicates, you just want to list the name in column B if it's found in Sheet1? –  Issun Aug 15 '11 at 10:29

3 Answers 3

This sounds like you just need a simple VLOOKUP formula.

=VLOOKUP(Sheet1!A2,Sheet2!A1:B20,2,FALSE)

where A2 is the value on Sheet 1 you want to look up, and A1:B20 is the entire table on Sheet2.

share|improve this answer

Use a simple IF formula instead.

In cell B1 enter:

=IF(sheet1!$A1=sheet2!$A1,$A1)

and copy down as far as you need to go.

share|improve this answer
=IF((F2=""),G2,F2) 

This means: if cell F2 is blank, return G2, else return the value of F2.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.