Unique dropdown list from column data

sparky2205

Active Member
Joined
Feb 6, 2013
Messages
480
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I want to create a dropdown list from a column of data that contains duplicates and blanks.
The dropdown list should contain 1 of each data entry with no blanks.

Sample data:
ESI

GL

ESI
ESI

AZ

ESI

ESI
ESI

SO

EG

I have tried =INDEX(Supervisors,MATCH(0,COUNTIF($E$3:E3,Supervisors),0)) with the above column being named Supervisors. But it doesn't work. Maybe due to the blanks?

Note: the data above is padded out to 10 chars with spaces. It comes from another system in that format.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
How about
Excel Formula:
=UNIQUE(FILTER(A2:A20,TRIM(A2:A20)<>""))
 
Upvote 0
How about
Excel Formula:
=UNIQUE(FILTER(A2:A20,TRIM(A2:A20)<>""))
Alas, I have neither UNIQUE nor FILTER functions.
Should I be displaying my Office Version differently to reflect this?
 
Upvote 0
Should I be displaying my Office Version differently to reflect this?
If you are using 365, then no. Although it might be worth mentioning in your posts that you don't yet have dynamic arrays.
 
Upvote 0
Can you work any magic without the use of the new functions?
 
Upvote 0
How about
+Fluff v2.xlsm
ABC
1
2ESIESI
3GL
4GLAZ
5SO
6ESIEG
7ESI 
8
9AZ
10
11ESI
12
13ESI
14ESI
15
16SO
17
18EG
19
20
Main
Cell Formulas
RangeFormula
C2:C7C2=IFERROR(INDEX($A$2:$A$20,AGGREGATE(15,6,(ROW($A$2:$A$20)-ROW($A$2)+1)/((ISNA(MATCH($A$2:$A$20,C$1:C1,0))+(TRIM($A$2:$A$20)=""))=1),1)),"")
 
Upvote 0
This is the data I have run your formula on:
Supervisor
SO
SO
SO
SO
MT
MT
MT
MT
MT
JOR
JOR
AZ
AZ
AZ
AZ
GL
GL
AP
AP
AP
AP
AP
CM
CM
CM
CM
CM
ESI
AZ
AZ
SO
SO
SO
MP
MP
ESI
AZ
AZ
AZ
AZ
AZ
RL
RL
AS
AS
AS
AS
AS
AS
AS
AZ
AZ
AZ
AZ
AZ
AS
ESI
ESI
PJ
PJ
RG
RG
RG
RG
RG
The data is in H3:H1000 with my result beginning in Q3 and filling down. So I adjusted your formula so:
=IFERROR(INDEX($H$3:$H$1000,AGGREGATE(15,6,(ROW($H$3:$H$1000)-ROW($H$3)+1)/((ISNA(MATCH($H$3:$H$1000,Q$1:Q1,0))+(TRIM($H$3:$H$1000)=""))=1),1)),"")

This works fine in terms of skipping blanks and skipping repeats that are separated by blanks.
However it brings back 2 of each entry instead of 1.

So my result in Q is:


SO
SO
MT
MT
JOR
JOR
AZ
AZ
GL
GL
AP
AP
CM
CM
ESI
ESI
MP
MP
RL
RL
AS
AS
PJ
PJ
RG
RG
For clarity, I refer to each group of values separated by a blank as a block.
So, for each block of repeat values, regardless of the number of entries, I get 2 of that value.
If a value is repeated in another block further down the column it is ignored and that is perfect.

It looks like it's very close.
 
Upvote 0
Some of the values have a blank after them & some don't, so try
Excel Formula:
=IFERROR(INDEX(TRIM($H$3:$H$1000),AGGREGATE(15,6,(ROW($H$3:$H$1000)-ROW($H$3)+1)/((ISNA(MATCH(TRIM($H$3:$H$1000),Q$2:Q2,0))+(TRIM($H$3:$H$1000)=""))=1),1)),"")
 
Upvote 0
Yes, that worked perfectly.
Roll on Excel upgrade, when I consider your originally proposed formula using UNIQUE andFILTER compared to the final result without.

One more question if I may. How would I use this result as a dynamic range for my dropdown?
If I set up a named range or a table the range will still need to have all cells populated with the formula which I'm assuming will result in blanks in the dropdown where the formula results in a blank.
 
Upvote 0
You can use
Excel Formula:
=OFFSET($Q$3,,,COUNTIFS($Q$3:$Q$1000,"><"))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,026
Messages
6,122,743
Members
449,094
Latest member
dsharae57

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