Forum Discussion

chealy79's avatar
chealy79
Copper Contributor
Apr 19, 2023

sort column descending - but not alphabetically

I have a column of data which I want to flip. So the bottom of the column becomes the top and the top becomes the bottom, but I don't want it to be alphabetically, I need the data in order, just flipped... can anyone suggest a method ?

8 Replies

  • chealy79 

    To reverse the order of records in a table, you first need the array showing the current order 'k'.  Then you output rows in descending order of k.

    = LET(
          k, SEQUENCE(ROWS(table)),
          SORTBY(table, k, -1)
      )

    Of course you need not leave messy formulas showing on the worksheet.  You could use

    = Reverseλ(table)

     

  • davidleal's avatar
    davidleal
    Iron Contributor

    chealy79 I think you can handle it via SORTBY, for example, this is one way of doing it for the following sample, I would suggest next time share your sample data in an Excel file, so we can accommodate the solution to your specific problem:

     

    =SORTBY(A1:B3,-SEQUENCE(ROWS(A1:A3)))

     

    Here is a sample:

    You can also use ROW for a sorter approach:

     

    =SORTBY(A1:B3,-ROW(A1:A3))

     

    I hope it helps,

     

    David

    • chealy79's avatar
      chealy79
      Copper Contributor
      Hello Quadruple Pawn, thanks for your quick suggestion... I'm not sure though if this may work in my scenario... I have a column of text, that I simply copy from a table, but I need to reverse the order and then enter a text in the cell next to it.... as you can see from my image I'll try and attach.
      • OliverScheurich's avatar
        OliverScheurich
        Gold Contributor

        chealy79 

        Is the data in the left column already in reverse order or is this the unsorted data? And can you share the rule for the text you want to add in the adjacent cell? Perhaps you give an example of the text that you copy from a table and of the data in reverse order.

Resources