Hope someone can help me with the following problem.

Let say in column A we have different letters, column B have different numbers, the letters in column A are associated with the numbers in column B, A1->B1, A2->B2. I want in column C sort the numers from column B, smallest to largest and in column D I want to sort the letters. So if B2 smallest, C1=B2 and then A2=D1.

This is how it looks in excel.


A1=T, A2=G, B1=2, B2=1
C1: =MINSTA($B$1:$B$2;1) =>C1=1
C2: =MINSTA($B$1:$B$2;2) =>C2=2

So what formula should I write in D1 and D2 to sort column A in column D efter the sort resalt by column B in column C?. The result should give D1=G, D2=T in my example