Copy data based on one column to another column based on another column

daloudin

New Member
Joined
Mar 10, 2009
Messages
4
For each value in Column B of Sheet 2 I want to find that value in Column A of Sheet 1 and paste the value from Column A of Sheet 2 in Column C of Sheet 1...

Sheet 2
GW%7D00058.BMP


Sheet 1
GW%7D00060.BMP
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
We are converting the id's in our database and the output files used by other departments need a cross reference. Rather than do it all by hand I'm trying to get Excel to find the matching information and paste the data for me. Their data is in Sheet 2 with a column called "NEW" that has text in it that matches up to our "LN700" column in Sheet 1.

For each value in the "NEW" column of Sheet 2 I want to find that exact value in the "LN700" column of Sheet 1 and then copy the value beside the "NEW" column of Sheet 2 ("OLD") in to the "OLD" column of Sheet 1.

Once this is done I can sort on Column C in Sheet 1 and export them a txt list for use in their processes.

Excel Workbook
ABC
1LN700Tagname
2AL1912AMAM_875
3AL1912AMPAmpsB_022
4AL1912FL311FL311_002
5AL1912FL321FL321_002
6AL1912FL351FL351_063
7AL1912FLMEFLPSI_004
8AL1912FLTPFLDC_077
9AL1912LKLK_283
10AL1912LRLR_554
11AL1912MCOMMMComm_002
12AL1912OCAL_1912
13AL1912RCOMMRComm_062
14AL1912VARSMVAR_087
15AL1912WATTMW_020
16AL1922AAMPAmpsA_012
17AL1922AMAM_872
18AL1922BAMPAmpsB_019
19AL1922C1FLPSI_002
20AL1922CAMPAmpsC_012
21AL1922FLDCFLDC_075
22AL1922LKLK_280
23AL1922LRLR_551
24AL1922OCAL_1922
25AL1922VARSMVAR_084
26AL1922WATTMW_017
27AL1932AAMPAmpsA_013
28AL1932AMAM_873
29AL1932BAMPAmpsB_020
30AL1932CAMPAmpsC_013
31AL1932FLDCFLDC_076
32AL1932FLMEFLPSI_003
Sheet1


Excel Workbook
AB
1OLDNEW
2AL1932AAVAL1932AAMP
3AL1932BAVAL1932BAMP
4AL1932CAVAL1932CAMP
5AL1932UAVAL1932UAMP
6AL1932VARVAL1932VARS
7AL1932WATVAL1932WATT
8ALBUS2AGVVALBUS2AGVB
9ALBUS2BGVVALBUS2BGVB
10ALBUS2CGVVALBUS2CGVB
11ALBUS2VARVALBUS2VARS
12ALBUS2WATVALBUS2WATT
13ARBUS3VLTVARBUS3AGV
14ARBUS3VARVARBUS3VARS
15ARBUS3WATVARBUS3WATT
16AREUAMPVAREUAMP
17AREVR1AMPVAREVR1AMP
18AREVR1PFVAREVR1VAR
19AREVR1VLTVAREVR1VLT
20AREVR2AMPVAREVR2AMP
21AREVR2PFVAREVR2VAR
22AREVR2VLTVAREVR2VLT
23AREVR3AMPVAREVR3AMP
24AREVR3PFVAREVR3VAR
25AREVR3VLTVAREVR3VLT
26ARFUAMPVARFUAMP
27ARFVR1AMPVARFVR1AMP
28ARFVR1PFVARFVR1VAR
29ARFVR1VLTVARFVR1VLT
30ARFVR2AMPVARFVR2AMP
31ARFVR2PFVARFVR2VAR
32ARFVR2VLTVARFVR2VLT
Sheet2
 
Upvote 0
...and an example of what it would look like afterwards:

Excel Workbook
ABC
1LN700TagnameOLD
2AL1912AMAM_875
3AL1912AMPAmpsB_022
4AL1912FL311FL311_002
5AL1912FL321FL321_002
6AL1912FL351FL351_063
7AL1912FLMEFLPSI_004
8AL1912FLTPFLDC_077
9AL1912LKLK_283
10AL1912LRLR_554
11AL1912MCOMMMComm_002
12AL1912OCAL_1912
13AL1912RCOMMRComm_062
14AL1912VARSMVAR_087
15AL1912WATTMW_020
16AL1922AAMPAmpsA_012
17AL1922AMAM_872
18AL1922BAMPAmpsB_019
19AL1922C1FLPSI_002
20AL1922CAMPAmpsC_012
21AL1922FLDCFLDC_075
22AL1922LKLK_280
23AL1922LRLR_551
24AL1922OCAL_1922
25AL1922VARSMVAR_084
26AL1922WATTMW_017
27AL1932AAMPAmpsA_013AL1932AAV
28AL1932AMAM_873
29AL1932BAMPAmpsB_020AL1932BAV
30AL1932CAMPAmpsC_013AL1932CAV
31AL1932FLDCFLDC_076
32AL1932FLMEFLPSI_003
33AL1932LKLK_281
Sheet1
 
Upvote 0
In C2 of Sheet1 and copied down try

=IF(ISNUMBER(MATCH(A2,Sheet2!B:B,0)),INDEX(Sheet2!A:A,MATCH(A2,Sheet2!B:B,0)),"")
 
Upvote 0
Perfect. Thank you... I got hung up on VLookUp and never thought about a straight logical tie. This worked perfect.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,478
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top