copy the data based on same total number between 2 sheets

reza_doang

Board Regular
Joined
May 31, 2010
Messages
187
Hi All -

need your help :)
i hope i can explain it with well

i want to copy data column based on total of number.
let says, I have the master data in sheet 1
and sheet 2, is my working sheet.

- in sheet 2 100200 has 2 line then it will copy the data from master data (sheet 1).
- in sheet 2 100300 has 1 line, while in master has 2 lines, so it will ignore
- in sheet 2 100400 has 1 line, while in master don't have that number, so it will ignore
- in sheet 2 300100 has 3 line, same with in master sheet, has 3 line, so it will copy the number.

based on this sample, is it possible to do that?

Master Data (Sheet 1)
NumbersItem
1002001
1002002
1003001
1003002
3001001
3001002
3001003

<tbody>
</tbody>















Working sheet (Sheet 2)


NumbersExpected result
1002001
1002002
100300NA
100400NA
3001001
3001002
3001003

<tbody>
</tbody>















Thank you in advance

regards,
reza
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
FORmula in sheet 2 cell B2

=IF(COUNTIF($A$2:$A$8,A2)=COUNTIF(Sheet1!$A$2:$A$8,Sheet2!A2),INDEX(Sheet1!$B$2:$B$8,AGGREGATE(15,6,ROW($A$2:$A$8)-ROW($A$2)+1/(A2=Sheet1!$A$2:$A$8),COUNTIF($A$2:A2,A2))),"NA")


NOTE:
incress range as your data range


HZZZClK.png
 
Upvote 0

Forum statistics

Threads
1,203,683
Messages
6,056,722
Members
444,887
Latest member
cvcc_wt

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