Results 1 to 7 of 7

Thread: sort letters

  1. #1

    sort letters



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello


    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.

    ...A....B...C...D
    1T.....2....1...G
    2G....1....2...T

    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

  2. #2
    Super Moderator NBVC's Avatar
    Join Date
    May 2011
    Location
    Mississauga, Canada
    Posts
    1,491
    Articles
    0
    Excel Version
    Excel 2016
    I am not sure what language version you are using.

    In English Excel, it would be:

    =INDEX($A$1:$A$2;MATCH(C1;$B$1:$B$2;0))

    copied down


  3. #3
    Super Moderator NBVC's Avatar
    Join Date
    May 2011
    Location
    Mississauga, Canada
    Posts
    1,491
    Articles
    0
    Excel Version
    Excel 2016
    It looks like it might be Swedish?

    If so, translation should be:

    =INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))


  4. #4
    Quote Originally Posted by NBVC View Post
    It looks like it might be Swedish?

    If so, translation should be:

    =INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))
    yes, swedish and thanks for help but I got one problem with your code, maybe I dit something wrong. I use then

    D1=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=T, I WANT D1=G

    D2=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=T

    Did you know what I did wrong?

  5. #5
    Quote Originally Posted by thed9071 View Post
    yes, swedish and thanks for help but I got one problem with your code, maybe I dit something wrong. I use then

    D1=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=T, I WANT D1=G

    D2=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=T

    Did you know what I did wrong?
    I saw I write wrong in my answer I mean:


    D1=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=G

    D2=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=G, I WANT D2=T

  6. #6
    Quote Originally Posted by NBVC View Post
    It looks like it might be Swedish?

    If so, translation should be:

    =INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))
    I saw I write wrong in my answer I mean:

    yes, swedish and thanks for help but I got one problem with your code, maybe I dit something wrong. I use then

    D1=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=G

    D2=INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0))=G, I WANT D2=T

  7. #7
    Super Moderator NBVC's Avatar
    Join Date
    May 2011
    Location
    Mississauga, Canada
    Posts
    1,491
    Articles
    0
    Excel Version
    Excel 2016
    After you enter: =INDEX($A$1:$A$2;PASSA(C1;$B$1:$B$2;0)) in D1, you need to copy down the formula to D2. The C1 should change to C2.

    To copy down the formula, select cell D1, click and hold the little black box at the bottom right corner of the cell and drag down to D2, then let go.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •