# Removing Duplicates Function in Excel 2007

#### J_Kelley

##### New Member
I have a worksheet where I have the records sorted in a particular order. I am using the remove duplicates function within Excel 2007. I am hoping that it will automatically keep the first record found for each set of dupes. Can anybody confirm if this will be true.

### Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

#### VoG

##### Legend
I may be exceptionally thick but why does it matter which record it keeps if they are duplicates?

#### J_Kelley

##### New Member
I am only using one column to determine whether its a dupe or not. My goal is to keep the record with the most recent printed date. I have my worksheet sorted so that this record is always on top. So my question is, Does anybody know if the Excel function will always keep the first record that is found in the dupe set?

Order #, Order Date, Printed Date
12345, 1070527, 1070727
12345, 1070527, 1070623

#### Gerald Higgins

##### Well-known Member
In that case, why not try it and see ?

#### QuietRiot

##### Well-known Member
if you sort by date first it should keep whatever is at the top assuming now that it works from bottom up

#### J_Kelley

##### New Member
I have tried it and it seems to be the case but I have too many records to check them all. I was hoping that somebody would know for sure.

#### Gerald Higgins

##### Well-known Member
If you wanted to double check, you could do so like this.
First, sort the data so that it is in the order you said.
Then, put this formula in row 2 of a helper column (assumes your order #s are in Col A, starting on row 2)
Code:
``=if(A2=A1,0,1)``
This will put a 1 on the first record, and a zero on any duplicates (including multiple duplicates).
Copy this formula all the way down, then copy the whole column and paste special, values.
Then extract the duplicates, and do a Data, AutoFilter on what you've got left. You should have only 1s left over in your helper column, which you can then delete. If you've got any 0s, something's gone wrong . . .

#### J_Kelley

##### New Member
Thanks Gerald. That's a great idea I'll do that now.

Replies
5
Views
199
Replies
3
Views
1K
Replies
5
Views
108
Replies
12
Views
520
Replies
9
Views
543

1,191,200
Messages
5,985,237
Members
439,953
Latest member
suchitha

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