Search code examples
sortinggoogle-sheetsgoogle-sheets-formula

Inversing Rows, ignoring empty cells


I am using Google Sheets and I am trying to inverse an array while ignoring the blank cells. However, I managed to inverse it but I can't get GS to ignore the blank cells.

Thanks for your help!

Link to the sample input: Inversing an array, ignoring blank cells

What I tried:

=INDEX($B$12:$B$19,rows(B12:$B$19))

Solution

  • Try the following formula-

    =IFERROR(HSTACK(A12:A19,TOCOL(CHOOSECOLS(SORT(A12:B19,1,0),2),1)),"")
    

    If you only want colors name then could try-

    =TOCOL(CHOOSECOLS(SORT(A12:B19,1,0),2),1)
    

    enter image description here