Hi again

Now it's a different type of comparison:

A B C D E F
A B C

I want to get the highest letter in cell A1, that'll say I want the value of D2. But it has to get the value in E2 if the letter D is there and in B2 the letter A.

I've tried with some if's but they didn't really work out