# Compare cells in different worksheets

M

#### Mike

I have a need to compare column A in a sheet1 to A in sheet2 and if equal
move the value of Column B in sheet2 to Column B in Sheet 1. I have read the
vlookup, index, match examples but I am unable to get it to work. Below is
some sample data.

Any help would be appreciated.

Sheet1 Column A Cells 1 thru 11
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
III
JJJ
KKK

Sheet2 Column A Cells 1 thru 11 Sheet2 Column B Cells 1 thru 11
AAA 1
BBB 2
111 3
222 4
EEE 5
FFF 6
555 7
666 8
JJJ 9
444 10
KKK 11

The result should be (Sheet1)
Column A Col B
AAA 1
BBB 2
CCC
DDD
EEE 5
FFF 6
GGG
HHH
III
JJJ 9
KKK 11

Ad

S

#### Sheeloo

Try this in B1 of Sheet1
=VLOOKUP(A1,Sheet2!A:B,2,False)
and copy down

This will give you the values from Col B of Sheet2 where Col A matches with
A1 and #N/A where it does not. To suppress the #N/A use this
=IF(ISNA(VLOOKUP(A1,Sheet2!A:B,2,False)),"",VLOOKUP(A1,Sheet2!A:B,2,False))

M

#### Mike

Sheeloo,

Thanks, your solution worked great. I had a similar one but for some reason
it did not work, I will need to compare the two.

Thanks again for the help.

Ad

S

#### Sheeloo

You are most welcome.

I am happy that it worked out for you.

-Sheeloo

## Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.