Compare and copy data from one column to another

Solved/Closed
VBLearner Posts 3 Registration date Monday November 19, 2012 Status Member Last seen November 20, 2012 - Nov 19, 2012 at 10:52 AM
Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 - Nov 20, 2012 at 05:04 PM
Hello,

I'm trying to compare column A in Sheet 1 with column A in Sheet 2, then copy corresponding values in column N from sheet 1 to column N in Sheet 2 (where the column A values match). Also, the values in Column A Sheet 1 might not be in the same order or sequence as the values in Column A Sheet 2.

Appreciate any help!

4 responses

Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 69
Nov 19, 2012 at 12:06 PM
Hi VBLearner,

You can use the Vlookup worksheet function to accomplish this task. According to your explanations I prepared the following sheet:

Sheet1
________________________________________________________________
VluesASheet1 ValuesNSheet1
________________________________________________________________
Name01 ABCD01
Name02 ABCD02
Name03 ABCD03
Name04 ABCD04
Name05 ABCD05
Name06 ABCD06
Name07 ABCD07
________________________________________________________________

Sheet2
________________________________________________________________
ValuesASheet2 ValuesNSheet2
________________________________________________________________
Name01 ABCD01
Name02 ABCD02
Name09
Name10
Name11
Name12
Name13
________________________________________________________________

Use the below mentioned formula in column N of Sheet2:

=VLOOKUP(A2,Sheet1!A2:N8,14,0)

You must replace Sheet1!A2:N8 with your range of data in Sheet1. You can see that Name 01 and Name02 is common in both the sheets so a value is present in column N of sheet2.

Please revert for clarification.
0
VBLearner Posts 3 Registration date Monday November 19, 2012 Status Member Last seen November 20, 2012
Nov 20, 2012 at 07:29 AM
I tried using the formula you mentioned and modified the range value and the sheet name according to the data I have and still it's not working. I am getting the error #Name. Here's what I used: =VLOOKUP(A2,All Requirements!A2:N7677,14,0).
0
VBLearner Posts 3 Registration date Monday November 19, 2012 Status Member Last seen November 20, 2012
Nov 20, 2012 at 03:18 PM
Thanks, the formula you gave initially works. I was missing the quotes on the Sheet 1 name.
Thanks for your help!
0
Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 69
Nov 20, 2012 at 05:04 PM
Hi VBLearner,

Replace:

=VLOOKUP(A2,All Requirements!A2:N7677,14,0)

With:

=VLOOKUP(A2,'All Requirements'!A2: N7677,14,0)

Note the quotes in the above formula. "All Requirements" should always be enclosed in quotes if it a sheet in the same excel file.

Please revert for clarification.
0