View Single Post
  #34   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Magic Excel function or UDF?

On Sat, 24 Sep 2011 18:18:51 GMT, Oliver Annells wrote:

This formula array entered (Ctrl+Shift+Enter) works without any VBA.

=MAX((TRANSPOSE(MID($A$18,ROW($A$1:INDEX(A:A,LEN( $A$18))),1))=MID($C5,ROW($A$1:INDEX(A:A,LEN($C5))) ,1))*TRANSPOSE(ROW($A$1:INDEX(A:A,LEN($A$18)))))

When I entered this the word was in C5 and the alphabet string was in A18.




I made Alphabet a Defined Name.
With the alphabet string in F1,
Alphabet Refers To: =MID(Sheet1!$F$1,ROW(INDIRECT("1:99")),1)


This makes Alphabet an array constant with each letter a single element, then:

array-entered: =MAX(MATCH(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),A lphabet,0)) gives the requested results.