Match cell contents from different sheets and if match, copy another cell's contents.

Emo113

New Member
Joined
Jan 17, 2013
Messages
28
Hello all,

I have a complicated request that I can't seem to solve.

I have two sheets with two columns in each sheet. I want to search the contents of Column A in Sheet1 against the contents of Column A in Sheet2 and if they match, I want to take the corresponding contents from the B column in Sheet2 and copy it to the corresponding B column of the matched A cell in Sheet1.

So far I found a way to match the contents and I get a Y or N if there is a match, but I can't find a way to copy the contents from Sheet2 to Sheet1 for the corresponding cell found.

My formula is

Code:
=IF(ISNA(MATCH(A2,Sheet2!$A2:$A31398,0)),"N","Y")

I have a header so that's why I'm starting at 2.

Thanks for any help!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

caabyyc

Board Regular
Joined
Oct 24, 2013
Messages
126
Sheet 1Sheet 2
ABCAB
1idCHKContent(in sheet 2 if matched)1idContent
2AY12A1
3BY23B2
4CY34C3
5DNNot Found5C4
6EY56E5
Enter following in C1 of Sheet 1,then copy to bottom.
IF(B2="Y",INDEX(Sheet2!B:B,MATCH(Sheet1!A2,Sheet2!A:A,)),"Not Found")

<colgroup><col style="width: 48pt;" width="64"> <col style="width: 23pt; mso-width-source: userset; mso-width-alt: 1080;" width="30"> <col style="width: 23pt; mso-width-source: userset; mso-width-alt: 1109;" width="31"> <col style="width: 140pt; mso-width-source: userset; mso-width-alt: 6656;" width="187"> <col style="width: 48pt;" span="3" width="64"> <tbody>
</tbody>


you have to confirm there is no duplicated items in column A of sheet 2,example, C in column A of sheet 2 was intentionally added as duplicated item, you will only see the content in B for the first matched "C".(form top to bottom)

Hello all,

I have a complicated request that I can't seem to solve.

I have two sheets with two columns in each sheet. I want to search the contents of Column A in Sheet1 against the contents of Column A in Sheet2 and if they match, I want to take the corresponding contents from the B column in Sheet2 and copy it to the corresponding B column of the matched A cell in Sheet1.

So far I found a way to match the contents and I get a Y or N if there is a match, but I can't find a way to copy the contents from Sheet2 to Sheet1 for the corresponding cell found.

My formula is

Code:
=IF(ISNA(MATCH(A2,Sheet2!$A2:$A31398,0)),"N","Y")

I have a header so that's why I'm starting at 2.

Thanks for any help!
 
Upvote 0

Forum statistics

Threads
1,195,960
Messages
6,012,566
Members
441,710
Latest member
needhelp_please

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
Top