# Ignoring Duplicate entries from drop down list

#### Frisbee Dog

##### New Member
I have a data list where a user can select a value. This list is linked to a separate file which is changed often.

I am using a drop down list box via data validation. Currently, the code I have below works great, as it ignores values that are blank. But, sometimes duplicate entries appear. I would like one of the duplicate to show, but the other to be ignored. I can't figure out how to do this. Please help. Thanks.

Code:
``=OFFSET(C331,0,0,COUNTIF(\$C\$331:\$C\$525,">"""),1)``

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

#### PCL

##### Well-known Member
Your formula DON'T ignore empty cells when they are inside the list.
A possibility could be to use another list prepared from the first one where all duplicate and empty cells are removed.
Assuming :
data in A2:A8
the second list in D2:D8
Put next formula (coming from someone in this forum) in D2, confirm using CONTROL + SHIFT + ENTER (Area formula)
Copy D2 and drop down
=IF(ROWS(D\$2:D2)<=C\$2,INDEX(A\$2:A\$8,SMALL(IF(FREQUENCY(IF(A\$2:A\$8<>"",MATCH("~"&A\$2:A\$8,A\$2:A\$8&"",0)),ROW(A\$2:A\$8)-ROW(A\$2)+1),ROW(A\$2:A\$8)-ROW(A\$2)+1),ROWS(D\$2:D2))),"")

#### PCL

##### Well-known Member
Or prepare a macro to filter
The first cell where to put filtered data is named = Extract_List
The HEADER where to pick up data is named = Type
Code:
``````Option Explicit
Sub List_Unic_Prepa()
Dim I As Long, J As Long
Dim LASTROW As Long
Dim MyRG As Range
Dim MyCOL As Integer
Dim MyROW As Long
'---------   CLEAR  PREVIOUS  CONTENTS    ----------
Range(Range("EXTRACT_LIST").Offset(1, 0), Range("EXTRACT_LIST").End(xlDown)).ClearContents
'---------   COLLECT  DATA    ----------
MyROW = Range("TYPE").Row
MyCOL = Range("TYPE").Column
LASTROW = Cells(Rows.Count, MyCOL).End(xlUp).Row
J = 1
For I = MyROW + 1 To LASTROW
Set MyRG = Range(Range("Type"), Cells(I, MyCOL))
If (WorksheetFunction.CountIf(MyRG, Cells(I, MyCOL)) = 1) Then
Range("EXTRACT_LIST").Offset(J, 0) = Cells(I, MyCOL)
J = J + 1
End If
Next I
End Sub``````

Replies
5
Views
98
Replies
9
Views
90
Replies
2
Views
114
Replies
4
Views
83
Replies
2
Views
97

1,127,594
Messages
5,625,693
Members
416,127
Latest member
MALEPINZON

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