Home |
Search |
Today's Posts |
#5
![]() |
|||
|
|||
![]()
"Mike S" <Mike wrote...
Am trying to figure out if a user-defined function can be created to alphabetically re-order a text with multiple words. For example. "Hotel Paris Hilton" should convert to "Hilton Hotel Paris" "Paris" is then the last word because "H" is before "P" in the alphabet "Hilton" is the first word because "i" is before "o" in the Alphabet and so on and so forth. Easiest way to do this would be to use add-in functions from Laurent Longre's MOREFUNC.XLL add-in, available from http://xcell05.free.fr/english/ If you install MOREFUNC.XLL, try the array formula =MCONCAT(VSORT(MID(A1,SMALL(IF(MID(" "&A1,INTVECTOR(1024,1),1)=" ",INTVECTOR(1024,1)), INTVECTOR(WORDCOUNT(A1),1)),SMALL(IF(MID(A1&" ",INTVECTOR(1024,1),1)=" ", INTVECTOR(1024,1)),INTVECTOR(WORDCOUNT(A1),1))-SMALL(IF(MID(" "&A1, INTVECTOR(1024,1),1)=" ",INTVECTOR(1024,1)),INTVECTOR(WORDCOUNT(A1),1))), ,1)," ") or use a defined name like seq referring to =ROW(INDIRECT("1:1024")), which would allow shortening the formula to =MCONCAT(VSORT(MID(A1,SMALL(IF(MID(" "&A1,seq,1)=" ",seq),INTVECTOR(WORDCOUNT(A1),1)), SMALL(IF(MID(A1&" ",seq,1)=" ",seq),INTVECTOR(WORDCOUNT(A1),1)) -SMALL(IF(MID(" "&A1,seq,1)=" ",seq),INTVECTOR(WORDCOUNT(A1),1))),,1)," ") |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Justify text across multiple columns | Excel Discussion (Misc queries) | |||
want to remove all text characters equal to one character in length from text string | Excel Worksheet Functions | |||
Finding Specific Text in a Text String | Excel Worksheet Functions | |||
multiple text files URGENT | Excel Discussion (Misc queries) | |||
importing multiple text files??? | Excel Discussion (Misc queries) |