# Comparing/Copying Duplicate Data - Help please?

#### tristanbw

##### New Member
I have one spreadsheet with three tabs: Glossary1, Glossary2, and Duplicates. I would like to compare column A of Glossary1 to column A of Glossary2 and then have any data that is in both Glossary1 and Glossary 2 (duplicate data) copied to column A of the tab called Duplicates.

What formula would work best here and can anyone provide a working example please?

Thanks!
TristanBW

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

#### vinman

##### New Member
in cell A1 of Duplicates

=IF(ISERROR(VLOOKUP(Glossary1!A1,Glossary2!A:A,1,FALSE)),"",(VLOOKUP(Glossary1!A1,Glossary2!A:A,1,FALSE)))

Drag this formula down as many rows as there are in Glossary 1. After you are done you can past the values and then sort the results so that all of the blanks are at the bottom.

Vinman

#### tristanbw

##### New Member
Thanks for the formula! Also, is there a way to do conditional formatting that would highlight the duplicates in each of the tabs or change the font color? I've seen this formula for use in one column but not across sheets.

#### vinman

##### New Member
The way you need to do that is name the range column A in the duplicates tab. Call it "duplicates". Then in Glossary1 cell a1 use the conditional format function select formula is and insert the this formula =VLOOKUP(A1,duplicates,1,FALSE)=A1. Then select the format you want to use to highlight the duplicates. After you are done you can use the paint brush function to copy the format all the way down column A

Vinman

#### tristanbw

##### New Member
Vinman,

Thanks again for your help! You saved the day!!

Replies
4
Views
82
Replies
5
Views
240
Replies
6
Views
151
Replies
3
Views
261
Replies
5
Views
207

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,152,120
Messages
5,768,227
Members
425,460
Latest member
Astros1243

### 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.

### Which adblocker are you using?

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

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