View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default The Kth element in a text list

It might be able to be done.....but, it depends on what you're really
working with.
So, if your posted example does not reflect actual scenario, we need to know.

That being said....Maybe something like this?

With this list of 3-letter values in A1:A10
abc
add
def
aab
bft
dhi
wcl
zet
drw
jkl

B1: (the rank item you want....eg 5 means you want the 5th smallest)

This formula returns that ranked item from the list
C1:
=INDEX(A1:A10,MATCH(SMALL(INDEX(--(CODE(MID(UPPER(A1:A10),1,1))&CODE(MID(UPPER(A1:A1 0),2,1))&CODE(MID(UPPER(A1:A10),3,1))),0),B1),INDE X(--(CODE(MID(UPPER(A1:A10),1,1))&CODE(MID(UPPER(A1:A1 0),2,1))&CODE(MID(UPPER(A1:A10),3,1))),0),0))

or....if you prefer an ARRAY FORMULA version (committed with ctrl+shift+enter)
C1:
=INDEX(A1:A10,MATCH(SMALL(--(CODE(MID(UPPER(A1:A10),1,1))&CODE(MID(UPPER(A1:A1 0),2,1))&CODE(MID(UPPER(A1:A10),3,1))),B1),--(CODE(MID(UPPER(A1:A10),1,1))&CODE(MID(UPPER(A1:A1 0),2,1))&CODE(MID(UPPER(A1:A10),3,1))),0))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"kjs" wrote:

=Small(A1:A5,2) from
12
15
12
10
17
returns the value 12, but what from
def
ghi
qrs
def
abc
returns "def" as the second lowest, by sort order
or ascii value?
I can get as far as =MIN(CODE(A1:A5)) entered
as an array formula giving 97, the lowest ascii
value of the first letter, but then I come off the rails.
Any ideas?

kjs