Home > database >  Filter Function within Sort
Filter Function within Sort

Time:01-29

I am trying to create an excel formula which will sort the Sales Rep Column in Descending order based on the Units Column where the Product is Apple (Refer Attached).

Not sure how do I achieve it. Can anyone please help me?

enter image description here

CodePudding user response:

You could include the column you want to sort on in the FILTER, then wrap the whole thing in INDEX to just return the column you want:

=INDEX(SORT(FILTER(B5:D12,C5:C12=F2),3,-1),,1)

CodePudding user response:

Another approach is using SORTBY like this: =SORTBY(FILTER(B5:B12,C5:C12=F2),FILTER(D5:D12,C5:C12=F2),-1)

The SORTBY range has the same filter as the Result range.

  •  Tags:  
  • Related