2

I have the following:

=sort(filter('CASES LIST'!C:R,('CASES LIST'!Q:Q="admission")+('CASES LIST'!Q:Q="pending")+('CASES LIST'!Q:Q="PCI")),16,true)

but I want to sort in the following sequence:

Pending first
admission second
PCI third

1 Answer 1

1

Please use the following query formula (adjusting ranges to your needs), instead of the filter one you already use.

=QUERY(sort(P1:R,match(Q1:Q,{"Pending","admission","PCI"},0),TRUE), 
               "where Col2 matches 'admission|PCI|pending' ",0)

enter image description here

Functions used:

2
  • Please remember that as per site guidelines when an answer addresses your question, accept it and even upvote it so others can benefit as well. Commented Jan 6, 2021 at 9:31
  • What do you mean as a must? Commented Jan 6, 2021 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.