Thread: Unique lists
View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Unique lists

"Sean Howard" wrote
.....
1) Is it possible to exclude blank cells from the unique list? I
forgot about that possibility in the original question.


An option to play around with,
which will exclude blanks in the unique list ..

Meanings:
--------------
Uniques = 1st instance of the item in the list,
Duplicates = 2nd, 3rd, etc instances of the item in the list

Note that there's no case sensitivity distinction for uniques,
i.e. RTL = rtl = RtL (all are considered identical, not unique)

Assume the original data is
in Sheet1, in cols A and B,
-------------------------------------
data from row1 down, viz.:
(names in col B)

1 RTL
2 RTL
3 RTL
4 TV2
5 Viasat
6 Viasat

etc

Put in say, E1:
=IF(OR(COUNTIF($B$1:B1,B1)1,B1=""),"",ROW())

Copy E1 down by a safe "max" number of rows
that data will be expected in col B, down to say, E100?
(can copy down ahead of expected data input in cols A and B)

In Sheet2
-------------
Select B1:B100
(a range of the same size as col E in Sheet1)

Put in the *formula bar*:

=IF(ISERROR(MATCH(SMALL(Sheet1!E:E,ROW(B1:B100)),S heet1!E:E,0)),"",INDEX(She
et1!B:B,MATCH(SMALL(Sheet1!E:E,ROW(B1:B100)),Sheet 1!E:E,0)))

Array-enter the formula with CTRL+SHIFT+ENTER
instead of just pressing ENTER

Put in A1: =IF(B1="","",ROW())
Copy down to A100
(cover the same range as before)

The above will extract and sequentially number
the list of uniques from Sheet1's col B
w/o any blank rows in-between ..

2) What if the result had to look a bit like this :-
Order Unique
1 RTL
3 Viasat
4 Duna
where I would only want to see the 1st, 3rd and
4th unique strings from the original list. Is that doable?


In Sheet3
-------------
Assuming the "pre-defined" list of unique strings desired for
viewing from Sheet2 will be numbered in col A,
in A1 downwards, viz.:
1
3
4

Put in B1:
=IF(A1="","",VLOOKUP(A1,Sheet2!A:B,2,0))

Copy B1 down to B100
(to match the same range size as col E in Sheet1)

The above will return the results that you're after

Adapt to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----