Re: making multiple lists from one, with uniqueness
- From: "T. Valko" <biffinpitt@xxxxxxxxxxx>
- Date: Wed, 29 Jul 2009 13:19:17 -0400
I assume you want these lists for data validation drop down lists?
It'll take a couple of steps. First, you have to identify the unique items
then you have to extract those unique items into the individual lists.
Let's assume your data is in the range A1:B19
Enter this formula in C1 and copy down to C19. This will identify the
uniques.
=IF(SUMPRODUCT(--(A$1:A1&"_"&B$1:B1=A1&"_"&B1))=1,ROW(),"")
Now let's extract those uniques into the individual lists.
In some out of the way location on your sheet, say, X1:Z1, enter the 3
unique names for the lists:
X1 = Bar
Y1 = Baz
Z1 = Foo
Enter this array formula** in X2:
=INDEX($B:$B,MATCH(SMALL(IF($A$1:$A$19=X$1,$C$1:$C$19),ROWS(X$2:X2)),$C$1:$C$19,0))
Copy across to Y2 then down until you get a solid row of #NUM! errors. You
can hide those #NUM! errors if you want to but I'd just leave them there
since these extracted lists are out of sight.
Now, setup the drop down lists...
Assume you want the drop downs to appear in cells:
E1 = Bar
E2 = Baz
E3 = Foo
Select cell E1
Goto the menu Data>Validation
Allow: List
Source:
=X2:INDEX(X2:X100,COUNTIF(X2:X100,"*"))
OK
Repeat this for cells E2 and E3.
Source for E2:
=Y2:INDEX(Y2:Y100,COUNTIF(Y2:Y100,"*"))
Source for E3:
=Z2:INDEX(Z2:Z100,COUNTIF(Z2:Z100,"*"))
--
Biff
Microsoft Excel MVP
"Phil" <spam-me@xxxxxxxxx> wrote in message
news:uFwUpoFEKHA.4432@xxxxxxxxxxxxxxxxxxxxxxx
Here's an example of my data:
Foo Fighter
Foo Fighter
Foo Lishness
Foo Lishness
Bar Nun
Bar Exam
Foo D'Eluvit
Bar Oque
Bar D'Eluvit
Bar Nun
Foo Lishness
Foo Lishness
Baz Luhrmann
Foo Lishness
Baz Ooka
Baz Ooka
Baz Ebeez
Foo Manchu
Foo Manchu
How can I extract from that a set of lists of Foo's (Fighter, Lishness,
D'Eluvit, Manchu), Bar's (Nun, Exam, Oque, D'Eluvit) and Baz's (Luhrmann,
Ooka, Ebeez) for data validation? I'd like each item to appear only once
in whichever list(s) it applies to, but I don't care about the order.
Pick a Foo: ______
Pick a Bar: ______
Pick a Baz: ______
.
- References:
- Prev by Date: Re: conditional formatting of dates
- Next by Date: RE: Auto Fill Down Macro
- Previous by thread: RE: making multiple lists from one, with uniqueness
- Next by thread: rounding numbers
- Index(es):
Relevant Pages
|