View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
golddave via OfficeKB.com golddave via OfficeKB.com is offline
external usenet poster
 
Posts: 11
Default List Disctinct Strings from Range of Cells

I'm getting what appear to be random numbers from these formulas.

Max wrote:
One formulas play which will dynamically list the unique names, sorted
alphabetically by the leftmost letter (its not a true alphabetic sort, but
might suffice for your purpose). The sort criteria is set to make no
distinction between lower/upper case names

Source names assumed listed in Sheet1, in A2 down
In Sheet2,
In A2:
=IF(Sheet1!A2="","",IF(COUNTIF(Sheet1!A$2:A2,Shee t1!A2)1,"",CODE(UPPER(LEFT(Sheet1!A2)))+ROW()/10^10))

In B2
=IF(ISERROR(SMALL(A:A,ROWS($1:1))),"",INDEX(Sheet 1!A:A,MATCH(SMALL(A:A,ROWS($1:1)),A:A,0)))
Copy A2:B2 down to cover the max expected extent of source data, say down to
B100. Minimize/hide away the criteria col A. Col B returns the required list
of uniques, sorted in alpha sequence by the leftmost letter (case
insensitive) as mentioned above. Unique names with the same leftmost letter
will be listed in the relative order that they appear within the source. Any
good? Hit the YES below.
I have a spreadsheet where Sheet A contains names (including duplicates) in a
range. I'd like Sheet 2 to list the distinct names in alphabetical order.
Any ideas?


--
Message posted via http://www.officekb.com