Duplicates

zacemmel

Well-known Member
Joined
Apr 29, 2002
Messages
636
I have seen several posts on the forum regarding duplicates. Most peope resort to UDFs and VBA to remove duplicates. That isn't neccesary. You can remove duplicates with the functions that are built-in to Excel.

Check out the formula I created below:

=IF(ROW()=ROW($A$1),$A$1,IF(ISERROR(INDIRECT("a"&MIN(IF(MATCH($A$1:$A$13,$A$1:$A$13,0)>MATCH(B1,$A$1:$A$13,0),MATCH($A$1:$A$13,$A$1:$A$13,0),99999)))),"",INDIRECT("a"&MIN(IF(MATCH($A$1:$A$13,$A$1:$A$13,0)>MATCH(B1,$A$1:$A$13,0),MATCH($A$1:$A$13,$A$1:$A$13,0),99999)))))
This message was edited by zacemmel on 2002-05-02 11:02
 
On 2002-05-02 17:25, Ricky Morris wrote:
OK I'm lost. I have Jan, Feb... etc in cells A1 thru A13. Which cell(s) should I put this formula to display the unique values.

Hi Ricky,

With Zacemmel's formula, would type =A1 in cell B1 and his formula in B2 and copy down the list. For the one I posted, type it in B1 and copy down the list.

Bye,
Jay
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Zacemmel, this is pretty good. I'm impressed. However, I used the following test data and the formula yeilded incorrect result.

A1 jan
A2 feb
A3 mar
A4 apr
A5 may
A6 jun
A7 jul
A8 aug
A9 sep
A10 oct
A11 nov
A12 dec
A13 jan
A14 ricky

The last unique cell, A14, was not displayed by the formula.
 
Upvote 0
Zac,

extending the range as per your suggestion to the flaw posted by Ricky :

=IF(ROW()=ROW($A$1),$A$1,IF(ISERROR(INDIRECT("a"&MIN(IF(MATCH($A$1:$A$50,$A$1:$A$50,0)>MATCH(B1,$A$1:$A$50,0),MATCH($A$1:$A$50,$A$1:$A$50,0),99999)))),"",INDIRECT("a"&MIN(IF(MATCH($A$1:$A$50,$A$1:$A$50,0)>MATCH(B1,$A$1:$A$50,0),MATCH($A$1:$A$50,$A$1:$A$50,0),99999)))))

does not work

"Ricky" does not show up as a unique entry.
Neither do any items in the list that proceed a numeric duplication, as I pointed out earlier.....

try replacing "feb" with "111"

then replace "jul" with "111"

everything below *will* disappear.

I hope this filters through... you don't seem to want to understand !!

good luck

:)
 
Upvote 0
I understand my own formula. The range HAS to be full. If the range specified in the formula isn't full, it will not work. If the range is full, my formula works. You people just aren't using it correctly.
 
Upvote 0
The purpose of my post is to get rid of duplicates without using VBA, sorting, or filtering without getting spaces between records.
 
Upvote 0
Zac,

it's a wonderful formula, I like it.

Alas, it doesn't quite work.

I just filled my range per my example above and it fails.

Would you like to post an example range that does work so that *we* can see where *us people* are going wrong ?

Full marks for the time and trouble you've invested.... let's finish this off for posterity.

Chris
:)
 
Upvote 0
On 2002-05-03 14:54, zacemmel wrote:
The purpose of my post is to get rid of duplicates without using VBA, sorting, or filtering without getting spaces between records.

Right... I didn't use VBA, AutoFilter, or the Data | Sort menu command. It works effortlessly... even on 10,000 rows.
 
Upvote 0
Here's a solution taken from John Walkenbach's Excel 2000 Formulas book.

The source list containing the duplicates is named data. This is a multi-cell array. It should be entered at once in a range with the same number of rows as "data". Like all arrays it should be entered by pressing Ctl-Shift-Enter together.

=INDEX(data,SMALL(IF(MATCH(data,data,0)=ROW(INDIRECT("1:"&ROWS(data))),MATCH(data,data,0),""),ROW(INDIRECT("1:"&ROWS(data)))))
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,167
Members
448,870
Latest member
max_pedreira

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