Duplicates

Karti

New Member
Joined
Mar 26, 2009
Messages
5
Hi all,

I have a worksheet with 3 tabs:

DataOne - DataTwo - Duplicates

I am trying to copy duplicates from worksheet one and worksheet two to the duplicates worksheet.

If there are duplicates I would like them both transferred to the Duplicates worksheet so both lines can be compared. As part of this I would like the the whole rows to be copied across from Data One and Two

Any ideas are warmly welcomed :)

Regards

K
:)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Karti:

There has to be a lot of assumptions in your question as there isn't a lot of detail. However, I don't mind stepping out on a limb to see if I can help. Caution - This could get lengthy.

Assumption 1 - There is something in column A that would denote a duplicate.


Step 1 - On the DataOne tab (Out past your data) in row 2, try
=IF(ISERROR(MATCH(A2,DataTwo!$A$2:$A$1000,0)),"","Duplicate")
Copy down to all rows - Note the 1,000 is flexible, it needs to go to the bottom of your data.

Effect - The formula looks in Column A of the DataTwo tab for the value in the cell of column A on the DataOne tab. If it doesn't find a match, nothing happens (""), but if it does find a match, it marks it with a duplicate.

Step 2 - Next to the Duplicate column (assumed to be column J) created in Step 1, add a counting row
=if(J2="Duplicate",K1+1,K1)

Effect - Puts the next integer beside each new duplicate

Step 3 - On your duplicate tab, set up to import your duplicates
Column A is numbers from 1 to whatever you think you have duplicates to
Column B beside the 1 and then copied down
=INDEX(DataOne!$A$2:$A$1000,MATCH(A7,DataOne!$E$2:$E$1000,0),1)

Effect - In the DataOne Column A, it counts down to the row that was the integer beside the new duplicate.

Step 4 - Import the rest of the data using VLookup
In Column C - Bring DataTwo column A
=Vlookup($A2,DataTwo!$A$2:$I$1000,1,0)
In Column D - Bring DataOne column B
=Vlookup($A2,DataOne!$A$2:$I$1000,2,0)
In Column E - Bring DataTwo column B
=Vlookup($A2,DataTwo!$A$2:$I$1000,2,0)

Continue the Vlookups as far as you'd like.

Effect - Brings over the values from DataOne and DataTwo for comparison purposes.

So with that rambling, you have a solution. Depending on your experience, this may be very foreign. Try putting the formulas in to see them work and then strive to understand them. On the other hand, if all this makes sense right out of the gate, good luck!

Jeff
 
Upvote 0
Jeff,

Many thanks for assisting. To give a better idea I have added a link to explain more:
spreadsheet.png



I have the first tab with 15 records. The second tab has a futher set of records. I need to transfer the duplicates from DataOne and from DataTwo to Duplicates so that we can compare all the data in the duplicate range.

This is to see if mistakes have been found during an audit. By having different colours in the main tabs it allows us to view it in a more simpler mannor. I hope that helps a bit more.

Thanks for the help so far.

Regards

K
;)
 
Upvote 0
little bit of initial set up required but this works as per your sample data. Create the list of dups based on the formulas in K column, then create the vlookups based on the results

Excel Workbook
ABCDEFGHIJKLMNO
1Column1Column2Column3Column4Column1Column2Column3Column4DupsVlookups
21abc5abc55abc
32abc6abc65abc
43abc7abc76abc
54abc8abc86abc
65abc9abc97abc
76abc10abc107abc
87abc11xyz118abc
98abc12xyz128abc
109abc13xyz139abc
1110abc14xyz149abc
1211abc15xyz1510abc
1312abc16xyz10abc
1413abc17xyz11abc
1514abc18xyz11xyz
1615abc19xyz12abc
1712xyz
1813abc
1913xyz
2014abc
2114xyz
2215abc
2315xyz
Sheet3
Excel Workbook
M
2a
Sheet3
Excel Workbook
M
3a
Sheet3


hope you can make sense of the formulas, I've had to make them all on the same sheet for display purposes but you get the idea
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,750
Members
452,940
Latest member
rootytrip

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