excelexcel-formula

SORT formula with empy column in data range and descending order based on another column (not the first column in the data range)


0 A B C
1 Project A 500
2 Project B 200
3 Project C 600
4 Project D 300
5 Project E 100
6
7 Project C 600
8 Project A 500
9 Project D 300
10 Project B 200
11 Project E 100

In Range A7:B11 I want to sort the values from Range A1:A5 descending based on the values in Range C1:C5. Therefore, I tried to go with this formula:

=SORT(A1:C5;;-1)

However, when I do this the result looks like this:

enter image description here

How do I need to modify the SORT formula to

  1. get the list in the correct descending order based on the values in Range C1:C5?
  2. ignore the empty Column B within the Range A1:C5 and not displaying 0 values for it?

Solution

  • HSTACK(A1:A5,C1:C5) before sorting:

    =SORT(HSTACK(A1:A5,C1:C5),2,-1)
    

    enter image description here

    Or use CHOOSECOLS:

    =SORT(CHOOSECOLS(A1:C5,1,3),2,-1)
    

    enter image description here