PC Review


Reply
Thread Tools Rate Thread

Compare cells in different worksheets

 
 
Mike
Guest
Posts: n/a
 
      17th Feb 2009
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

--
Mike
 
Reply With Quote
 
 
 
 
Sheeloo
Guest
Posts: n/a
 
      17th Feb 2009
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))

"Mike" wrote:

> 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
>
> --
> Mike

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      19th Feb 2009
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.
--
Mike


"Sheeloo" wrote:

> 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))
>
> "Mike" wrote:
>
> > 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
> >
> > --
> > Mike

 
Reply With Quote
 
Sheeloo
Guest
Posts: n/a
 
      19th Feb 2009
You are most welcome.

I am happy that it worked out for you.

-Sheeloo
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare 2 worksheets for simliar cells and then comb into one work Adam.Bird@Choiceimaging.co.uk Microsoft Excel Misc 1 29th Jan 2008 01:18 AM
Compare cells in different worksheets carlos_ray86@hotmail.com Microsoft Excel Programming 1 5th Sep 2007 03:26 PM
Open two worksheets, then match and compare cells Bob Microsoft Excel Programming 0 8th Aug 2006 10:21 PM
How do I compare data in two worksheets to find matching cells? =?Utf-8?B?R2FyeQ==?= Microsoft Excel Misc 4 2nd Mar 2006 09:04 PM
Compare 2 cells in 2 worksheets, rewrite one of the cells dbomb Microsoft Excel Programming 1 28th Sep 2004 09:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 PM.