Ignoring Duplicate entries from drop down list

Frisbee Dog

New Member
Joined
Aug 12, 2009
Messages
1
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)
 

Some videos you may like

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
Joined
Jul 15, 2008
Messages
1,348
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
Joined
Jul 15, 2008
Messages
1,348
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
 

Watch MrExcel Video

Forum statistics

Threads
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.
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
Top